---
title: "Reputation penalty - study 1"
author: "Jacob Ausubel, Annika Davies, and Ethan Porter"
date: "2025-08-28"
output:
  pdf_document:
    extra_dependencies: float
  word_document: default
  html_document:
    df_print: paged
fontsize: 12pt
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

# Study 1

```{r, include = FALSE, message = FALSE}
#Clear global environment
rm(list = ls())
```

```{r, include = FALSE, message = FALSE}
#Loading various packages
library(readr)
library(lmtest)
library(sandwich)
library(margins)
library(texreg)
library(haven)
library(MASS)
library(dplyr)
library(ggplot2)
library(ggrepel)
library(marginaleffects)
library(estimatr)
library(imputeTS)
library(fabricatr)
library(tidyr)
library(tidyverse)
library(lubridate)
library(qualtRics)
library(naniar)
library(RCT)
library(texreg)
library(huxtable)
library(stargazer)
library(ggpubr)
library(vtable)
library(cobalt)
library(kableExtra)
library(xtable)
library(ggthemes)
library(stats)
library(biostat3)
library(pwr)
library(effectsize)
```

```{r, include = FALSE, message = FALSE}
#Reading in data
#abortion_s1_private <- read_csv("Abortion Study_December 4, 2023_21.29.csv")
```

```{r, include = FALSE, message = FALSE}
#Removing variables that could be sensitive in a pubic release
#Also, filtering to just respondents with an IP Address
#abortion_s1_public <-
#  abortion_s1_private %>%
#  filter(Status == "IP Address")

#abortion_s1_public <-
#  abortion_s1_public %>%
#  select(-c(Status, IPAddress, ResponseId, RecipientLastName, RecipientFirstName, 
#            RecipientEmail, ExternalReference, LocationLatitude, LocationLongitude,
#            DistributionChannel, metainfo_Browser, metainfo_Version, 
#            `metainfo_Operating System`, metainfo_Resolution, state, MID))
```

```{r, include = FALSE, message = FALSE}
#Creating public CSV file
#write.csv(abortion_s1_public, "Abortion Study_December 4, 2023_21.29 - PUBLIC.csv", row.names = FALSE)
```

```{r message=FALSE, include=FALSE}
#Reading in data
abortion_s1 <- read_csv("Abortion Study_December 4, 2023_21.29 - PUBLIC.csv")
```

```{r, include = FALSE, message = FALSE}
#Filtering abortion dataset to just those who passed an attention check and consented
abortion_s1_cleaned <- abortion_s1 %>%
  filter(consent == "Yes") %>%
  filter(attention_check == "Extremely interested,Very interested")
```

```{r, include = FALSE, message = FALSE}
#Making misinformation reference category for Z_fc_1, Z_fc_2, and Z_fc_3
abortion_s1_cleaned$Z_fc_1 <- 
  as.factor(abortion_s1_cleaned$Z_fc_1)
abortion_s1_cleaned$Z_fc_1 <- 
  relevel(abortion_s1_cleaned$Z_fc_1, ref="misinformation")

abortion_s1_cleaned$Z_fc_2 <- 
  as.factor(abortion_s1_cleaned$Z_fc_2)
abortion_s1_cleaned$Z_fc_2 <- 
  relevel(abortion_s1_cleaned$Z_fc_2, ref="misinformation")

abortion_s1_cleaned$Z_fc_3 <- 
  as.factor(abortion_s1_cleaned$Z_fc_3)
abortion_s1_cleaned$Z_fc_3 <- 
  relevel(abortion_s1_cleaned$Z_fc_3, ref="misinformation")
```

## Question wordings

### Factual beliefs

fc_1_belief
"To what extent do you agree or disagree with the following statement? "Abortion pills are dangerous and '1 in 5 women will suffer a complication.'”

fc_2_belief
To the best of your knowledge, how accurate is this statement? “More contraception availability increases abortion demand."

fc_3_belief
To the best of your knowledge, how accurate is this statement? "If a 10-year-old became pregnant as a result of rape and terminated the pregnancy because it was threatening her life, then that's not an abortion."

```{r, include = FALSE, message = FALSE}
#Recoding 1st factual belief variable so on a 1-to-4 scale
abortion_s1_cleaned$fc_1_belief_clean <- NA
abortion_s1_cleaned$fc_1_belief_clean[
  abortion_s1_cleaned$fc_1_belief == "Very accurate"
  ] <- 4
abortion_s1_cleaned$fc_1_belief_clean[
  abortion_s1_cleaned$fc_1_belief == "Somewhat accurate"
  ] <- 3
abortion_s1_cleaned$fc_1_belief_clean[
  abortion_s1_cleaned$fc_1_belief == "Not very accurate"
  ] <- 2
abortion_s1_cleaned$fc_1_belief_clean[
  abortion_s1_cleaned$fc_1_belief == "Not at all accurate"
  ] <- 1
```

```{r, include = FALSE, message = FALSE}
#Recoding 2nd factual belief variable so on a 1-to-4 scale
abortion_s1_cleaned$fc_2_belief_clean <- NA
abortion_s1_cleaned$fc_2_belief_clean[
  abortion_s1_cleaned$fc_2_belief == "Very accurate"
  ] <- 4
abortion_s1_cleaned$fc_2_belief_clean[
  abortion_s1_cleaned$fc_2_belief == "Somewhat accurate"
  ] <- 3
abortion_s1_cleaned$fc_2_belief_clean[
  abortion_s1_cleaned$fc_2_belief == "Not very accurate"
  ] <- 2
abortion_s1_cleaned$fc_2_belief_clean[
  abortion_s1_cleaned$fc_2_belief == "Not at all accurate"
  ] <- 1
```

```{r, include = FALSE, message = FALSE}
#Recoding 3rd factual belief variable so on a 1-to-4 scale
abortion_s1_cleaned$fc_3_belief_clean <- NA
abortion_s1_cleaned$fc_3_belief_clean[
  abortion_s1_cleaned$fc_3_belief == "Very accurate"
  ] <- 4
abortion_s1_cleaned$fc_3_belief_clean[
  abortion_s1_cleaned$fc_3_belief == "Somewhat accurate"
  ] <- 3
abortion_s1_cleaned$fc_3_belief_clean[
  abortion_s1_cleaned$fc_3_belief == "Not very accurate"
  ] <- 2
abortion_s1_cleaned$fc_3_belief_clean[
  abortion_s1_cleaned$fc_3_belief == "Not at all accurate"
  ] <- 1
```

### Attitudinal beliefs

We would like to get your feelings toward some groups, leaders, and institutions who are in the news these days using something we call the feeling thermometer. Ratings between 50 degrees and 100 degrees mean that you feel favorable and warm toward the group, leader, or institution. Ratings between 0 degrees and 50 degrees mean that you don't feel favorable toward them and that you don't care too much for them. You would rate them at the 50 degree mark if you don't feel particularly warm or cold toward them. If we come to a group, leader, or institution whose name you don't recognize, you don't need to rate them.

thermometer_1
Alliance Defending Freedom

thermometer_2
Seth Gruber

thermometer_3
Americans United for Life

thermometer_5
Eric Swalwell

thermometer_6
PolitiFact

thermometer_7
Planned Parenthood

```{r, include = FALSE, message = FALSE}
#Recoding feeling thermometer variables so that they are numeric
abortion_s1_cleaned$thermometer_1 <- as.numeric(abortion_s1_cleaned$thermometer_1)
abortion_s1_cleaned$thermometer_2 <- as.numeric(abortion_s1_cleaned$thermometer_2)
abortion_s1_cleaned$thermometer_3 <- as.numeric(abortion_s1_cleaned$thermometer_3)
abortion_s1_cleaned$thermometer_5 <- as.numeric(abortion_s1_cleaned$thermometer_5)
abortion_s1_cleaned$thermometer_6 <- as.numeric(abortion_s1_cleaned$thermometer_6)
abortion_s1_cleaned$thermometer_7 <- as.numeric(abortion_s1_cleaned$thermometer_7)
```

## Regression tables: factual beliefs

### H1: Exposure to factual, corrective information (fact-checks) about abortion will reduce false beliefs about abortion immediately after exposure.

```{r, include = FALSE, message = FALSE}
#Running model
fit1_s1 <- lm_robust(fc_1_belief_clean ~ Z_fc_1, data = abortion_s1_cleaned)
```

```{r, echo = FALSE, results='asis'}
#Creating regresion table
texreg(fit1_s1, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Effect of fact-check on the belief that abortion pills are dangerous and that 1 in 5 women will suffer a complication (1-to-4 scale)", 
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, message = FALSE}
#Getting marginal effects (which we use later to create a graph)
ma_fit1_s1 <- margins(fit1_s1)
ma_2_fit1_s1 <- summary(ma_fit1_s1)
ma_2_fit1_s1$var <- ma_2_fit1_s1$factor
ma_2_fit1_s1$var[1] <- 1
ma_2_fit1_s1$var[2] <- 2
ma_2_fit1_s1$var <- as.numeric(ma_2_fit1_s1$var)
```

```{r, include = FALSE, message = FALSE}
#Running model
fit2_s1 <- lm_robust(fc_2_belief_clean ~ Z_fc_2, data = abortion_s1_cleaned)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit2_s1, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Effect of fact-check on the belief that more contraception availability increases abortion demand (1-to-4 scale)", 
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, message = FALSE}
#Getting marginal effects (which we use later to create a graph)
ma_fit2_s1 <- margins(fit2_s1)
ma_2_fit2_s1 <- summary(ma_fit2_s1)
ma_2_fit2_s1$var <- ma_2_fit2_s1$factor
ma_2_fit2_s1$var[1] <- 1
ma_2_fit2_s1$var[2] <- 2
ma_2_fit2_s1$var <- as.numeric(ma_2_fit2_s1$var)
```

```{r, include = FALSE, message = FALSE}
#Running model
fit3_s1 <- lm_robust(fc_3_belief_clean ~ Z_fc_3, data = abortion_s1_cleaned)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
#Regression output
texreg(fit3_s1, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Effect of fact-check on the belief that it's not an abortion if a 10-year-old became pregnant as a result of rape and terminated the pregnancy (1-to-4 scale)", 
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, message = FALSE}
#Getting marginal effects (which we use later to create a graph)
ma_fit3_s1 <- margins(fit3_s1)
ma_2_fit3_s1 <- summary(ma_fit3_s1)
ma_2_fit3_s1$var <- ma_2_fit3_s1$factor
ma_2_fit3_s1$var[1] <- 1
ma_2_fit3_s1$var[2] <- 2
ma_2_fit3_s1$var <- as.numeric(ma_2_fit3_s1$var)
```

### Factual beliefs graph

```{r, include = FALSE, warning = FALSE}
#Combining marginal effects from three fact-checks into a single data frame
#Rationale: we're going to use it later to create a graph
ma_combined_s1 <- rbind(ma_2_fit1_s1[2,], ma_2_fit2_s1[2,], ma_2_fit3_s1[2,])
ma_combined_s1$var <- ma_combined_s1$factor
ma_combined_s1$var[1] <- 1
ma_combined_s1$var[2] <- 2
ma_combined_s1$var[3] <- 3
ma_combined_s1$var <- as.numeric(ma_combined_s1$var)

ma_combined_2_s1 <- rbind(ma_2_fit1_s1[1,], ma_2_fit2_s1[1,], ma_2_fit3_s1[1,])
ma_combined_2_s1$var <- ma_combined_2_s1$factor
ma_combined_2_s1$var[1] <- 1
ma_combined_2_s1$var[2] <- 2
ma_combined_2_s1$var[3] <- 3
ma_combined_2_s1$var <- as.numeric(ma_combined_2_s1$var)
ma_combined_2_s1$AME <- -ma_combined_2_s1$AME
ma_combined_2_s1$lower <- -ma_combined_2_s1$lower
ma_combined_2_s1$upper <- -ma_combined_2_s1$upper
colnames(ma_combined_2_s1) <- c("factor", "AME", "SE", "z", "p", "upper", "lower", "var")

ma_combined_s1$factor <- NULL
ma_combined_2_s1$factor <- NULL
ma_combined_s1$effect <- "Fact-check"
ma_combined_2_s1$effect <- "Misinformation"
ma_combined_2_s1 <-
  ma_combined_2_s1 %>%
  select(AME, SE, z, p, lower, upper, var, effect)

ma_combined_s1_v2 <-
  rbind(ma_combined_s1, ma_combined_2_s1)
colnames(ma_combined_s1_v2) <-
  c("AME", "SE", "z", "p", "lower", "upper", "var", "Effect")
```

```{r, include = FALSE, message = FALSE}
#Creating Study 1 graph for effects of 
  #misinformation + fact-checks on factual beliefs
ma_combined_s1_v2$var[
  ma_combined_s1_v2$var == 1 & ma_combined_s1_v2$Effect == "Fact-check"
  ] <- 0.975
ma_combined_s1_v2$var[
  ma_combined_s1_v2$var == 2 & ma_combined_s1_v2$Effect == "Fact-check"
  ] <- 1.975
ma_combined_s1_v2$var[
  ma_combined_s1_v2$var == 3 & ma_combined_s1_v2$Effect == "Fact-check"
  ] <- 2.975

ma_combined_s1_v2$var[
  ma_combined_s1_v2$var == 1 & ma_combined_s1_v2$Effect == "Misinformation"
  ] <- 1.025
ma_combined_s1_v2$var[
  ma_combined_s1_v2$var == 2 & ma_combined_s1_v2$Effect == "Misinformation"
  ] <- 2.025
ma_combined_s1_v2$var[
  ma_combined_s1_v2$var == 3 & ma_combined_s1_v2$Effect == "Misinformation"
  ] <- 3.025

ma_combined_s1_v2$Effect <- 
  factor(ma_combined_s1_v2$Effect,
         levels = c("Misinformation", "Fact-check"))

factual_study1_graph <- ma_combined_s1_v2 %>%
  ggplot(aes(x=var, y=AME, color = Effect)) +
  geom_point() +
  geom_segment(aes(x = var, y = lower, xend = var, yend = upper)) +
  scale_x_continuous(breaks=c(1:3), 
      expand = expansion(mult = 0.3),
      labels=c("Abortion pills are \ndangerous and 1 in 5 women \nwill suffer a complication", 
        "More contraception \navailability increases \nabortion demand", 
        "It's not an abortion \nif a 10-year-old \nbecame pregnant \nas a result of \nrape and terminated \nthe pregnancy")) +
  geom_hline(yintercept = 0, linetype = "dashed", color = "purple") +
  xlab("") +
  ylab("Average effect \non false belief") +
  #ggtitle("On average, fact-checks reduce false beliefs about abortion") +
  scale_color_manual(
    values = c(
      "Misinformation" = "red",
      "Fact-check" = "blue"
    )) +
  theme_classic() +
  theme(axis.text.x = element_blank()) +
  scale_y_continuous(breaks = c(-1, -0.5, 0, 0.5, 1)) +
  expand_limits(y = c(-1.2, NA)) 

#Loading Study 2 data frame with marginal effects
load("ma_combined_attitudes_s2_v1.RData")

ma_combined_s2_v1$var[
  ma_combined_s2_v1$var == 1 & ma_combined_s2_v1$Effect == "Fact-check"
  ] <- 0.975
ma_combined_s2_v1$var[
  ma_combined_s2_v1$var == 2 & ma_combined_s2_v1$Effect == "Fact-check"
  ] <- 1.975
ma_combined_s2_v1$var[
  ma_combined_s2_v1$var == 3 & ma_combined_s2_v1$Effect == "Fact-check"
  ] <- 2.975

ma_combined_s2_v1$var[
  ma_combined_s2_v1$var == 1 & ma_combined_s2_v1$Effect == "Misinformation"
  ] <- 1.025
ma_combined_s2_v1$var[
  ma_combined_s2_v1$var == 2 & ma_combined_s2_v1$Effect == "Misinformation"
  ] <- 2.025
ma_combined_s2_v1$var[
  ma_combined_s2_v1$var == 3 & ma_combined_s2_v1$Effect == "Misinformation"
  ] <- 3.025

ma_combined_s2_v1$Effect <- 
  factor(ma_combined_s2_v1$Effect,
         levels = c("Misinformation", "Fact-check"))

#Creating Study 2 graph for effects of misinformation + fact-checks on factual beliefs
factual_study2_graph <- ma_combined_s2_v1 %>%
  ggplot(aes(x=var, y=AME, color = Effect)) +
  geom_point() +
  geom_segment(aes(x = var, y = lower, xend = var, yend = upper)) +
  scale_x_continuous(breaks=c(1:3), 
      expand = expansion(mult = 0.3),
      labels=c("Abortion pills \nare dangerous \nand 1 in 5 women \nwill suffer a complication", 
        "More contraception \navailability increases \nabortion demand", 
        "It's not an abortion \nif a 10-year-old became \npregnant as a result \nof rape and terminated \nthe pregnancy")) +
  geom_hline(yintercept = 0, linetype = "dashed", color = "purple") +
  xlab("False factual belief") +
  ylab("Average effect \non false belief") +
  scale_color_manual(
    values = c(
      "Misinformation" = "red",
      "Fact-check" = "blue"
    )) +
  theme_classic() +
  scale_y_continuous(breaks = c(-1, -0.5, 0, 0.5, 1)) +
  expand_limits(y = c(-1.2, NA)) 
```

```{r, echo = FALSE}
#Displaying both the Study 1 and Study 2 factual belief graphs
ggarrange(factual_study1_graph, factual_study2_graph, 
  labels = c("Study 1", "Study 2"),
  ncol = 1, nrow = 2,
  hjust=-5,
  heights = c(0.7,1))
```

### Does receptivity to fact-checks (that is, the correction - misinformation contrast) differ by prior exposure to fact-checks?

```{r, include = FALSE, message = FALSE}
#Making "sometimes" the reference category
abortion_s1_cleaned$media_factchecks <- 
  as.factor(abortion_s1_cleaned$media_factchecks)
abortion_s1_cleaned$media_factchecks <- 
  relevel(abortion_s1_cleaned$media_factchecks, ref="Sometimes")
```

```{r, include = FALSE, message = FALSE}
#Running model
fit1_s1b <- lm_robust(fc_1_belief_clean ~ Z_fc_1*media_factchecks, data = abortion_s1_cleaned)
```

```{r, include = FALSE, message = FALSE}
#Creating texreg object

#IMPORTANT: We originally showed results via interaction terms but switched 
  #to showing group-specific effects below for clarity.
#These are based on the SAME model.
fit1_s1b_v2 <- texreg(fit1_s1b, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check", "Frequently encounter fact-checks", "Never encounter fact-checks",
        "Control*Frequently encounter fact-checks", "Fact-check*Frequently encounter fact-checks", "Control*Never encounter fact-checks", "Fact-check*Never encounter fact-checks"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between frequently/never (vs. sometimes) encountering fact-checks and fact-check of claim that abortion pills are dangerous (1-to-4 scale)",
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, warning = FALSE}
#Extracting RMSE value
fit1_s1b_rmse <- as.numeric(sub('.*RMSE\\s*&\\s*\\$([0-9\\.]+)\\$.*', '\\1', fit1_s1b_v2[1]))
```

```{r, include = FALSE, warning = FALSE}
#Getting effects of assignment conditions by how often respondents encounter fact-checks
fit1_s1b_effects <- avg_comparisons(fit1_s1b, variables = "Z_fc_1", by = "media_factchecks")
```

```{r, include = FALSE, warning = FALSE}
#Creating texreg object
fit1_s1b_effects_v2 <- createTexreg(
  coef.names = c("Intercept", "Control (Sometimes encounter fact-checks)", "Control (Frequently encounter fact-checks)", 
                 "Control (Never encounter fact-checks)", "Fact-check (Sometimes encounter fact-checks)", 
                 "Fact-check (Frequently encounter fact-checks)", "Fact-check (Never encounter fact-checks)"),
  coef = c(as.numeric(fit1_s1b$coefficients[1]), fit1_s1b_effects$estimate),
  se = c(as.numeric(fit1_s1b$std.error[1]), fit1_s1b_effects$std.error),
  pvalues = c(as.numeric(fit1_s1b$p.value[1]), fit1_s1b_effects$p.value),
  gof = c(as.numeric(summary(fit1_s1b)[9]), 
          as.numeric(summary(fit1_s1b)[10]), 
          as.integer(summary(fit1_s1b)[13]), 
          fit1_s1b_rmse),
  gof.names = c("R$^2$", "Adj. R$^2$", "Num. obs", "RMSE")
)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit1_s1b_effects_v2,
  custom.coef.names = 
    c("Intercept", "Control (Sometimes encounter fact-checks)", "Control (Frequently encounter fact-checks)", 
                 "Control (Never encounter fact-checks)", "Fact-check (Sometimes encounter fact-checks)", 
                 "Fact-check (Frequently encounter fact-checks)", "Fact-check (Never encounter fact-checks)"),
  caption = "Effect of fact-check on the belief that abortion pills are dangerous and that 1 in 5 women
will suffer a complication (1-to-4 scale)",
  caption.above = TRUE, 
  float.pos = "H",
  single.row = "TRUE")
```


```{r, include = FALSE, message = FALSE}
#Running model
fit2_s1b <- lm_robust(fc_2_belief_clean ~ Z_fc_2*media_factchecks, data = abortion_s1_cleaned)
```

```{r, include = FALSE, message = FALSE}
#Creating texreg object

#IMPORTANT: We originally showed results via interaction terms but switched 
  #to showing group-specific effects below for clarity.
#These are based on the SAME model.
fit2_s1b_v2 <- texreg(fit2_s1b, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check", "Frequently encounter fact-checks", "Never encounter fact-checks",
        "Control*Frequently encounter fact-checks", "Fact-check*Frequently encounter fact-checks", "Control*Never encounter fact-checks", "Fact-check*Never encounter fact-checks"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between frequently/never (vs. sometimes) encountering fact-checks and fact-check of claim that more contraception availability increases abortion demand (1-to-4 scale)",
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, warning = FALSE}
#Extracting RMSE value
fit2_s1b_rmse <- as.numeric(sub('.*RMSE\\s*&\\s*\\$([0-9\\.]+)\\$.*', '\\1', fit2_s1b_v2[1]))
```

```{r, include = FALSE, warning = FALSE}
#Getting effects of assignment conditions by how often respondents encounter fact-checks
fit2_s1b_effects <- avg_comparisons(fit2_s1b, variables = "Z_fc_2", by = "media_factchecks")
```

```{r, include = FALSE, warning = FALSE}
#Creating texreg object
fit2_s1b_effects_v2 <- createTexreg(
  coef.names = c("Intercept", "Control (Sometimes encounter fact-checks)", "Control (Frequently encounter fact-checks)", 
                 "Control (Never encounter fact-checks)", "Fact-check (Sometimes encounter fact-checks)", 
                 "Fact-check (Frequently encounter fact-checks)", "Fact-check (never encounter fact-checks)"),
  coef = c(as.numeric(fit2_s1b$coefficients[1]), fit2_s1b_effects$estimate),
  se = c(as.numeric(fit2_s1b$std.error[1]), fit2_s1b_effects$std.error),
  pvalues = c(as.numeric(fit2_s1b$p.value[1]), fit2_s1b_effects$p.value),
  gof = c(as.numeric(summary(fit2_s1b)[9]), 
          as.numeric(summary(fit2_s1b)[10]), 
          as.integer(summary(fit2_s1b)[13]), 
          fit2_s1b_rmse),
  gof.names = c("R$^2$", "Adj. R$^2$", "Num. obs", "RMSE")
)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit2_s1b_effects_v2,
  custom.coef.names = 
    c("Intercept", "Control (Sometimes encounter fact-checks)", "Control (Frequently encounter fact-checks)", 
                 "Control (Never encounter fact-checks)", "Fact-check (Sometimes encounter fact-checks)", 
                 "Fact-check (Frequently encounter fact-checks)", "Fact-check (Never encounter fact-checks)"),
  caption = "Effect of fact-check on the belief that more contraception availability increases abortion
demand (1-to-4 scale)",
  caption.above = TRUE, 
  float.pos = "H",
  single.row = "TRUE")
```

```{r, include = FALSE, message = FALSE}
#Running model
fit3_s1b <- lm_robust(fc_3_belief_clean ~ Z_fc_3*media_factchecks, data = abortion_s1_cleaned)
```

```{r, include = FALSE, message = FALSE}
#Creating texreg object

#IMPORTANT: We originally showed results via interaction terms but switched 
  #to showing group-specific effects below for clarity.
#These are based on the SAME model.
fit3_s1b_v2 <- texreg(fit3_s1b, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check", "Frequently encounter fact-checks", "Never encounter fact-checks",
        "Control*Frequently encounter fact-checks", "Fact-check*Frequently encounter fact-checks", "Control*Never encounter fact-checks", "Fact-check*Never encounter fact-checks"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between frequently/never (vs. sometimes) encountering fact-checks and fact-check of claim about 10-year-old terminating pregnancy (1-to-4 scale)",
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, warning = FALSE}
#Extracting RMSE value
fit3_s1b_rmse <- as.numeric(sub('.*RMSE\\s*&\\s*\\$([0-9\\.]+)\\$.*', '\\1', fit3_s1b_v2[1]))
```

```{r, include = FALSE, warning = FALSE}
#Getting effects of assignment conditions by how often respondents encounter fact-checks
fit3_s1b_effects <- avg_comparisons(fit3_s1b, variables = "Z_fc_3", by = "media_factchecks")
```

```{r, include = FALSE, warning = FALSE}
#Creating texreg object
fit3_s1b_effects_v2 <- createTexreg(
  coef.names = c("Intercept", "Control (Sometimes encounter fact-checks)", "Control (Frequently encounter fact-checks)", 
                 "Control (Never encounter fact-checks)", "Fact-check (Sometimes encounter fact-checks)", 
                 "Fact-check (Frequently encounter fact-checks)", "Fact-check (never encounter fact-checks)"),
  coef = c(as.numeric(fit3_s1b$coefficients[1]), fit3_s1b_effects$estimate),
  se = c(as.numeric(fit3_s1b$std.error[1]), fit3_s1b_effects$std.error),
  pvalues = c(as.numeric(fit3_s1b$p.value[1]), fit3_s1b_effects$p.value),
  gof = c(as.numeric(summary(fit3_s1b)[9]), 
          as.numeric(summary(fit3_s1b)[10]), 
          as.integer(summary(fit3_s1b)[13]), 
          fit3_s1b_rmse),
  gof.names = c("R$^2$", "Adj. R$^2$", "Num. obs", "RMSE")
)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit3_s1b_effects_v2,
  custom.coef.names = 
    c("Intercept", "Control (Sometimes encounter fact-checks)", "Control (Frequently encounter fact-checks)", 
                 "Control (Never encounter fact-checks)", "Fact-check (Sometimes encounter fact-checks)", 
                 "Fact-check (Frequently encounter fact-checks)", "Fact-check (Never encounter fact-checks)"),
  caption = "Effect of fact-check on the belief that it’s not an abortion if a 10-year-old became
pregnant as a result of rape and terminated the pregnancy (1-to-4 scale)",
  caption.above = TRUE, 
  float.pos = "H",
  single.row = "TRUE")
```

### Does receptivity to fact-checks (that is, the correction - misinformation contrast) differ by Party ID?

```{r, include = FALSE, message = FALSE}
#Recoding party ID variable
abortion_s1_cleaned$pid_1_cleaned <- abortion_s1_cleaned$pid_1
abortion_s1_cleaned$pid_1_cleaned[abortion_s1_cleaned$pid_1_cleaned == "Something else"] <- "Independent"
abortion_s1_cleaned$pid_1_cleaned[abortion_s1_cleaned$pid_1_cleaned == "Independent"] <- "Independent/Other"
```

```{r, include = FALSE, message = FALSE}
#Running model
fit1_s1c <- lm_robust(fc_1_belief_clean ~ Z_fc_1*pid_1_cleaned, data = abortion_s1_cleaned)
```

```{r, include = FALSE, message = FALSE}
#Creating texreg object

#IMPORTANT: We originally showed results via interaction terms but switched 
  #to showing group-specific effects below for clarity.
#These are based on the SAME model.
fit1_s1c_v2 <- texreg(fit1_s1c, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check", "Independent/Other", "Republican", 
      "Control*Independent/Other", "Fact-check*Independent/Other", "Control*Republican", "Fact-check*Republican"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between being a Republican/Independent (vs. being a Democrat) and fact-check of claim that abortion pills are dangerous (1-to-4 scale)",
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, warning = FALSE}
#Extracting RMSE value
fit1_s1c_rmse <- as.numeric(sub('.*RMSE\\s*&\\s*\\$([0-9\\.]+)\\$.*', '\\1', fit1_s1c_v2[1]))
```

```{r, include = FALSE, warning = FALSE}
#Getting effects of assignment conditions by partisanship
fit1_s1c_effects <- avg_comparisons(fit1_s1c, variables = "Z_fc_1", by = "pid_1_cleaned")
```

```{r, include = FALSE, warning = FALSE}
#Creating texreg object
fit1_s1c_effects_v2 <- createTexreg(
  coef.names = c("Intercept", "Control (Democrats)", "Control (Independent/Other)", 
                 "Control (Republicans)", "Fact-check (Democrats)", 
                 "Fact-check (Independent/Other)", "Fact-check (Republicans)"),
  coef = c(as.numeric(fit1_s1c$coefficients[1]), fit1_s1c_effects$estimate),
  se = c(as.numeric(fit1_s1c$std.error[1]), fit1_s1c_effects$std.error),
  pvalues = c(as.numeric(fit1_s1c$p.value[1]), fit1_s1c_effects$p.value),
  gof = c(as.numeric(summary(fit1_s1c)[9]), 
          as.numeric(summary(fit1_s1c)[10]), 
          as.integer(summary(fit1_s1c)[13]), 
          fit1_s1c_rmse),
  gof.names = c("R$^2$", "Adj. R$^2$", "Num. obs", "RMSE")
)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit1_s1c_effects_v2,
  custom.coef.names = 
    c("Intercept", "Control (Democrats)", "Control (Independent/Other)", 
                 "Control (Republicans)", "Fact-check (Democrats)", 
                 "Fact-check (Independent/Other)", "Fact-check (Republicans)"),
  caption = "Effect of fact-check on the belief that abortion pills are dangerous and that 1 in 5 women
will suffer a complication (1-to-4 scale)",
  caption.above = TRUE, 
  float.pos = "H",
  single.row = "TRUE")
```

```{r, include = FALSE, message = FALSE}
#Running model
fit2_s1c <- lm_robust(fc_2_belief_clean ~ Z_fc_2*pid_1_cleaned, data = abortion_s1_cleaned)
```

```{r, include = FALSE, message = FALSE}
#Creating texreg object

#IMPORTANT: We originally showed results via interaction terms but switched 
  #to showing group-specific effects below for clarity.
#These are based on the SAME model.
fit2_s1c_v2 <- texreg(fit2_s1c, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check", "Independent/Other", "Republican", 
      "Control*Independent/Other", "Fact-check*Independent/Other", "Control*Republican", "Fact-check*Republican"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between being a Republican/Independent (vs. being a Democrat) and fact-check of claim that more contraception availability increases abortion demand (1-to-4 scale)",
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, warning = FALSE}
#Extracting RMSE value
fit2_s1c_rmse <- as.numeric(sub('.*RMSE\\s*&\\s*\\$([0-9\\.]+)\\$.*', '\\1', fit2_s1c_v2[1]))
```

```{r, include = FALSE, warning = FALSE}
#Getting effects of assignment conditions by partisanship
fit2_s1c_effects <- avg_comparisons(fit2_s1c, variables = "Z_fc_2", by = "pid_1_cleaned")
```

```{r, include = FALSE, warning = FALSE}
#Creating texreg object
fit2_s1c_effects_v2 <- createTexreg(
  coef.names = c("Intercept", "Control (Democrats)", "Control (Independent/Other)", 
                 "Control (Republicans)", "Fact-check (Democrats)", 
                 "Fact-check (Independent/Other)", "Fact-check (Republicans)"),
  coef = c(as.numeric(fit2_s1c$coefficients[1]), fit2_s1c_effects$estimate),
  se = c(as.numeric(fit2_s1c$std.error[1]), fit2_s1c_effects$std.error),
  pvalues = c(as.numeric(fit2_s1c$p.value[1]), fit2_s1c_effects$p.value),
  gof = c(as.numeric(summary(fit2_s1c)[9]), 
          as.numeric(summary(fit2_s1c)[10]), 
          as.integer(summary(fit2_s1c)[13]), 
          fit2_s1c_rmse),
  gof.names = c("R$^2$", "Adj. R$^2$", "Num. obs", "RMSE")
)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit2_s1c_effects_v2,
  custom.coef.names = 
    c("Intercept", "Control (Democrats)", "Control (Independent/Other)", 
                 "Control (Republicans)", "Fact-check (Democrats)", 
                 "Fact-check (Independent/Other)", "Fact-check (Republicans)"),
  caption = "Effect of fact-check on the belief that more contraception availability increases abortion
demand (1-to-4 scale)",
  caption.above = TRUE, 
  float.pos = "H",
  single.row = "TRUE")
```

```{r, include = FALSE, message = FALSE}
#Running model
fit3_s1c <- lm_robust(fc_3_belief_clean ~ Z_fc_3*pid_1_cleaned, data = abortion_s1_cleaned)
```

```{r, include = FALSE, message = FALSE}
#Creating texreg object

#IMPORTANT: We originally showed results via interaction terms but switched 
  #to showing group-specific effects below for clarity.
#These are based on the SAME model.
fit3_s1c_v2 <- texreg(fit3_s1c, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check", "Independent/Other", "Republican", 
      "Control*Independent/Other", "Fact-check*Independent/Other", "Control*Republican", "Fact-check*Republican"),
      stars = c(0.05, 0.01, 0.001), 
      caption = "Interaction between being a Republican/Independent (vs. being a Democrat) and fact-check of claim about 10-year-old terminating pregnancy (1-to-4 scale)",
      caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, warning = FALSE}
#Extracting RMSE value
fit3_s1c_rmse <- as.numeric(sub('.*RMSE\\s*&\\s*\\$([0-9\\.]+)\\$.*', '\\1', fit3_s1c_v2[1]))
```

```{r, include = FALSE, warning = FALSE}
#Getting effects of assignment conditions by partisanship
fit3_s1c_effects <- avg_comparisons(fit3_s1c, variables = "Z_fc_3", by = "pid_1_cleaned")
```

```{r, include = FALSE, warning = FALSE}
#Creating texreg object
fit3_s1c_effects_v2 <- createTexreg(
  coef.names = c("Intercept", "Control (Democrats)", "Control (Independent/Other)", 
                 "Control (Republicans)", "Fact-check (Democrats)", 
                 "Fact-check (Independent/Other)", "Fact-check (Republicans)"),
  coef = c(as.numeric(fit3_s1c$coefficients[1]), fit3_s1c_effects$estimate),
  se = c(as.numeric(fit3_s1c$std.error[1]), fit3_s1c_effects$std.error),
  pvalues = c(as.numeric(fit3_s1c$p.value[1]), fit3_s1c_effects$p.value),
  gof = c(as.numeric(summary(fit3_s1c)[9]), 
          as.numeric(summary(fit3_s1c)[10]), 
          as.integer(summary(fit3_s1c)[13]), 
          fit3_s1c_rmse),
  gof.names = c("R$^2$", "Adj. R$^2$", "Num. obs", "RMSE")
)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit3_s1c_effects_v2,
  custom.coef.names = 
    c("Intercept", "Control (Democrats)", "Control (Independent/Other)", 
                 "Control (Republicans)", "Fact-check (Democrats)", 
                 "Fact-check (Independent/Other)", "Fact-check (Republicans)"),
  caption = "Effect of fact-check on the belief that it’s not an abortion if a 10-year-old became
pregnant as a result of rape and terminated the pregnancy (1-to-4 scale)",
  caption.above = TRUE, 
  float.pos = "H",
  single.row = "TRUE")
```

### Does receptivity to fact-checks (that is, the correction - misinformation contrast) differ by political knowledge?

```{r, include = FALSE, message = FALSE}
#Creating political knowledge scale
abortion_s1_cleaned$pk_1_correct <-
  ifelse(abortion_s1_cleaned$pk_1 == "Six years", 1, 0)
abortion_s1_cleaned$pk_2_correct <-
  ifelse(abortion_s1_cleaned$pk_2 == "Twice", 1, 0)
abortion_s1_cleaned$pk_3_correct <-
  ifelse(abortion_s1_cleaned$pk_3 == "Rishi Sunak", 1, 0)

abortion_s1_cleaned$pk_scale <-
  abortion_s1_cleaned$pk_1_correct+abortion_s1_cleaned$pk_2_correct+abortion_s1_cleaned$pk_3_correct

abortion_s1_cleaned$pk_recoded <- NA
abortion_s1_cleaned$pk_recoded[
  abortion_s1_cleaned$pk_scale >= 0 & abortion_s1_cleaned$pk_scale <= 1
  ] <- "Low"
abortion_s1_cleaned$pk_recoded[
  abortion_s1_cleaned$pk_scale == 2
  ] <- "Medium"
abortion_s1_cleaned$pk_recoded[
  abortion_s1_cleaned$pk_scale == 3
  ] <- "High"
```

```{r, include = FALSE, message = FALSE}
#Making "medium" the reference category
abortion_s1_cleaned$pk_recoded <- 
  as.factor(abortion_s1_cleaned$pk_recoded)
abortion_s1_cleaned$pk_recoded <- 
  relevel(abortion_s1_cleaned$pk_recoded, ref="Medium")
```

```{r, include = FALSE, message = FALSE}
#Running model
fit1_s1d <- lm_robust(fc_1_belief_clean ~ Z_fc_1*pk_recoded, data = abortion_s1_cleaned)
```

```{r, include = FALSE, message = FALSE}
#Creating texreg object

#IMPORTANT: We originally showed results via interaction terms but switched 
  #to showing group-specific effects below for clarity.
#These are based on the SAME model.
fit1_s1d_v2 <- texreg(fit1_s1d, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check",
      "High political knowledge", "Low political knowledge",
      "Control*High political knowledge", "Fact-check*High political knowledge",
      "Control*Low political knowledge", "Fact-check*Low political knowledge"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between having high/low (vs. medium) political knowledge and fact-check of claim that abortion pills are dangerous (1-to-4 scale)",
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, warning = FALSE}
#Extracting RMSE value
fit1_s1d_rmse <- as.numeric(sub('.*RMSE\\s*&\\s*\\$([0-9\\.]+)\\$.*', '\\1', fit1_s1d_v2[1]))
```

```{r, include = FALSE, warning = FALSE}
#Getting effects of assignment conditions by level of political knowledge
fit1_s1d_effects <- avg_comparisons(fit1_s1d, variables = "Z_fc_1", by = "pk_recoded")
```

```{r, include = FALSE, warning = FALSE}
#Creating texreg object
fit1_s1d_effects_v2 <- createTexreg(
  coef.names = c("Intercept", "Control (Medium political knowledge)", "Control (High political knowledge)", 
                 "Control (Low political knowledge)", "Fact-check (Medium political knowledge)", 
                 "Fact-check (High political knowledge)", "Fact-check (Low political knowledge)"),
  coef = c(as.numeric(fit1_s1d$coefficients[1]), fit1_s1d_effects$estimate),
  se = c(as.numeric(fit1_s1d$std.error[1]), fit1_s1d_effects$std.error),
  pvalues = c(as.numeric(fit1_s1d$p.value[1]), fit1_s1d_effects$p.value),
  gof = c(as.numeric(summary(fit1_s1d)[9]), 
          as.numeric(summary(fit1_s1d)[10]), 
          as.integer(summary(fit1_s1d)[13]), 
          fit1_s1d_rmse),
  gof.names = c("R$^2$", "Adj. R$^2$", "Num. obs", "RMSE")
)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit1_s1d_effects_v2,
  custom.coef.names = 
    c("Intercept", "Control (Medium political knowledge)", "Control (High political knowledge)", 
                 "Control (Low political knowledge)", "Fact-check (Medium political knowledge)", 
                 "Fact-check (High political knowledge)", "Fact-check (Low political knowledge)"),
  caption = "Effect of fact-check on the belief that abortion pills are dangerous and that 1 in 5 women
will suffer a complication (1-to-4 scale)",
  caption.above = TRUE, 
  float.pos = "H",
  single.row = "TRUE")
```

```{r, include = FALSE, message = FALSE}
#Running model
fit2_s1d <- lm_robust(fc_2_belief_clean ~ Z_fc_2*pk_recoded, data = abortion_s1_cleaned)
```

```{r, include = FALSE, message = FALSE}
#Creating texreg object

#IMPORTANT: We originally showed results via interaction terms but switched 
  #to showing group-specific effects below for clarity.
#These are based on the SAME model.
fit2_s1d_v2 <- texreg(fit2_s1d, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check",
      "High political knowledge", "Low political knowledge",
      "Control*High political knowledge", "Fact-check*High political knowledge",
      "Control*Low political knowledge", "Fact-check*Low political knowledge"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between having high/low (vs. medium) political knowledge and fact-check of claim that more contraception availability increases abortion demand (1-to-4 scale)",
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, warning = FALSE}
#Extracting RMSE value
fit2_s1d_rmse <- as.numeric(sub('.*RMSE\\s*&\\s*\\$([0-9\\.]+)\\$.*', '\\1', fit2_s1d_v2[1]))
```

```{r, include = FALSE, warning = FALSE}
#Getting effects of assignment conditions by level of political knowledge
fit2_s1d_effects <- avg_comparisons(fit2_s1d, variables = "Z_fc_2", by = "pk_recoded")
```

```{r, include = FALSE, warning = FALSE}
#Creating texreg object
fit2_s1d_effects_v2 <- createTexreg(
  coef.names = c("Intercept", "Control (Medium political knowledge)", "Control (High political knowledge)", 
                 "Control (Low political knowledge)", "Fact-check (Medium political knowledge)", 
                 "Fact-check (High political knowledge)", "Fact-check (Low political knowledge)"),
  coef = c(as.numeric(fit2_s1d$coefficients[1]), fit2_s1d_effects$estimate),
  se = c(as.numeric(fit2_s1d$std.error[1]), fit2_s1d_effects$std.error),
  pvalues = c(as.numeric(fit2_s1d$p.value[1]), fit2_s1d_effects$p.value),
  gof = c(as.numeric(summary(fit2_s1d)[9]), 
          as.numeric(summary(fit2_s1d)[10]), 
          as.integer(summary(fit2_s1d)[13]), 
          fit2_s1d_rmse),
  gof.names = c("R$^2$", "Adj. R$^2$", "Num. obs", "RMSE")
)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit2_s1d_effects_v2,
  custom.coef.names = 
    c("Intercept", "Control (Medium political knowledge)", "Control (High political knowledge)", 
                 "Control (Low political knowledge)", "Fact-check (Medium political knowledge)", 
                 "Fact-check (High political knowledge)", "Fact-check (Low political knowledge)"),
  caption = "Effect of fact-check on the belief that more contraception availability increases abortion
demand (1-to-4 scale)",
  caption.above = TRUE, 
  float.pos = "H",
  single.row = "TRUE")
```

```{r, include = FALSE, message = FALSE}
#Running model
fit3_s1d <- lm_robust(fc_3_belief_clean ~ Z_fc_3*pk_recoded, data = abortion_s1_cleaned)
```

```{r, include = FALSE, message = FALSE}
#Creating texreg object

#IMPORTANT: We originally showed results via interaction terms but switched 
  #to showing group-specific effects below for clarity.
#These are based on the SAME model.
fit3_s1d_v2 <- texreg(fit3_s1d, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check",
      "High political knowledge", "Low political knowledge",
      "Control*High political knowledge", "Fact-check*High political knowledge",
      "Control*Low political knowledge", "Fact-check*Low political knowledge"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between having high/low (vs. medium) political knowledge and fact-check of claim about 10-year-old terminating pregnancy (1-to-4 scale)",
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, warning = FALSE}
#Extracting RMSE value
fit3_s1d_rmse <- as.numeric(sub('.*RMSE\\s*&\\s*\\$([0-9\\.]+)\\$.*', '\\1', fit3_s1d_v2[1]))
```

```{r, include = FALSE, warning = FALSE}
#Getting effects of assignment conditions by level of political knowledge
fit3_s1d_effects <- avg_comparisons(fit3_s1d, variables = "Z_fc_3", by = "pk_recoded")
```

```{r, include = FALSE, warning = FALSE}
#Creating texreg object
fit3_s1d_effects_v2 <- createTexreg(
  coef.names = c("Intercept", "Control (Medium political knowledge)", "Control (High political knowledge)", 
                 "Control (Low political knowledge)", "Fact-check (Medium political knowledge)", 
                 "Fact-check (High political knowledge)", "Fact-check (Low political knowledge)"),
  coef = c(as.numeric(fit3_s1d$coefficients[1]), fit3_s1d_effects$estimate),
  se = c(as.numeric(fit3_s1d$std.error[1]), fit3_s1d_effects$std.error),
  pvalues = c(as.numeric(fit3_s1d$p.value[1]), fit3_s1d_effects$p.value),
  gof = c(as.numeric(summary(fit3_s1d)[9]), 
          as.numeric(summary(fit3_s1d)[10]), 
          as.integer(summary(fit3_s1d)[13]), 
          fit3_s1d_rmse),
  gof.names = c("R$^2$", "Adj. R$^2$", "Num. obs", "RMSE")
)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit3_s1d_effects_v2,
  custom.coef.names = 
    c("Intercept", "Control (Medium political knowledge)", "Control (High political knowledge)", 
                 "Control (Low political knowledge)", "Fact-check (Medium political knowledge)", 
                 "Fact-check (High political knowledge)", "Fact-check (Low political knowledge)"),
  caption = "Effect of fact-check on the belief that it’s not an abortion if a 10-year-old became
pregnant as a result of rape and terminated the pregnancy (1-to-4 scale)",
  caption.above = TRUE, 
  float.pos = "H",
  single.row = "TRUE")
```

### Does receptivity to fact-checks (that is, the correction - misinformation contrast) differ by religiosity?

```{r, include = FALSE, message = FALSE}
#Creating religiosity variable
abortion_s1_cleaned$attend_cleaned <- "Low"
abortion_s1_cleaned$attend_cleaned[
  abortion_s1_cleaned$attendance == "A few times a year"
  ] <- "Medium"
abortion_s1_cleaned$attend_cleaned[
  abortion_s1_cleaned$attendance == "Once or twice a month"
  ] <- "Medium"
abortion_s1_cleaned$attend_cleaned[
  abortion_s1_cleaned$attendance == "Once a week"
  ] <- "High"
abortion_s1_cleaned$attend_cleaned[
  abortion_s1_cleaned$attendance == "More than once a week"
  ] <- "High"

#Making "medium" the reference category
abortion_s1_cleaned$attend_cleaned <-
  as.factor(abortion_s1_cleaned$attend_cleaned)
abortion_s1_cleaned$attend_cleaned <- 
  relevel(abortion_s1_cleaned$attend_cleaned, ref="Medium")
```

```{r, include = FALSE, message = FALSE}
#Running model
fit1_s1e <- lm_robust(fc_1_belief_clean ~ Z_fc_1*attend_cleaned, data = abortion_s1_cleaned)
```

```{r, include = FALSE, message = FALSE}
#Creating texreg object

#IMPORTANT: We originally showed results via interaction terms but switched 
  #to showing group-specific effects below for clarity.
#These are based on the SAME model.
fit1_s1e_v2 <- texreg(fit1_s1e, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check", "High attendance", "Low attendance",
        "Control*High attendance", "Fact-check*High attendance", "Control*Low attendance", "Fact-check*Low attendance"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between high/low (vs. medium) religious attendance and fact-check of claim that abortion pills are dangerous (1-to-4 scale)",
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, warning = FALSE}
#Extracting RMSE value
fit1_s1e_rmse <- as.numeric(sub('.*RMSE\\s*&\\s*\\$([0-9\\.]+)\\$.*', '\\1', fit1_s1e_v2[1]))
```

```{r, include = FALSE, warning = FALSE}
#Getting effects of assignment conditions by religiosity
fit1_s1e_effects <- avg_comparisons(fit1_s1e, variables = "Z_fc_1", by = "attend_cleaned")
```

```{r, include = FALSE, warning = FALSE}
#Creating texreg object
fit1_s1e_effects_v2 <- createTexreg(
  coef.names = c("Intercept", "Control (Medium religiosity)", "Control (High religiosity)", 
                 "Control (Low religiosity)", "Fact-check (Medium religiosity)", 
                 "Fact-check (High religiosity)", "Fact-check (Low religiosity)"),
  coef = c(as.numeric(fit1_s1e$coefficients[1]), fit1_s1e_effects$estimate),
  se = c(as.numeric(fit1_s1e$std.error[1]), fit1_s1e_effects$std.error),
  pvalues = c(as.numeric(fit1_s1e$p.value[1]), fit1_s1e_effects$p.value),
  gof = c(as.numeric(summary(fit1_s1e)[9]), 
          as.numeric(summary(fit1_s1e)[10]), 
          as.integer(summary(fit1_s1e)[13]), 
          fit1_s1e_rmse),
  gof.names = c("R$^2$", "Adj. R$^2$", "Num. obs", "RMSE")
)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit1_s1e_effects_v2,
  custom.coef.names = 
    c("Intercept", "Control (Medium religiosity)", "Control (High religiosity)", 
                 "Control (Low religiosity)", "Fact-check (Medium religiosity)", 
                 "Fact-check (High religiosity)", "Fact-check (Low religiosity)"),
  caption = "Effect of fact-check on the belief that abortion pills are dangerous and that 1 in 5 women
will suffer a complication (1-to-4 scale)",
  caption.above = TRUE, 
  float.pos = "H",
  single.row = "TRUE")
```

```{r, include = FALSE, message = FALSE}
#Running model
fit2_s1e <- lm_robust(fc_2_belief_clean ~ Z_fc_2*attend_cleaned, data = abortion_s1_cleaned)
```

```{r, include = FALSE, message = FALSE}
#Creating texreg object

#IMPORTANT: We originally showed results via interaction terms but switched 
  #to showing group-specific effects below for clarity.
#These are based on the SAME model.
fit2_s1e_v2 <- texreg(fit2_s1e, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check", "High attendance", "Low attendance",
        "Control*High attendance", "Fact-check*High attendance", "Control*Low attendance", "Fact-check*Low attendance"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between high/low (vs. medium) religious attendance and fact-check of claim that more contraception availability increases abortion demand (1-to-4 scale)",
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, warning = FALSE}
#Extracting RMSE value
fit2_s1e_rmse <- as.numeric(sub('.*RMSE\\s*&\\s*\\$([0-9\\.]+)\\$.*', '\\1', fit2_s1e_v2[1]))
```

```{r, include = FALSE, warning = FALSE}
#Getting effects of assignment conditions by religiosity
fit2_s1e_effects <- avg_comparisons(fit2_s1e, variables = "Z_fc_2", by = "attend_cleaned")
```

```{r, include = FALSE, warning = FALSE}
#Creating texreg object
fit2_s1e_effects_v2 <- createTexreg(
  coef.names = c("Intercept", "Control (Medium religiosity)", "Control (High religiosity)", 
                 "Control (Low religiosity)", "Fact-check (Medium religiosity)", 
                 "Fact-check (High religiosity)", "Fact-check (Low religiosity)"),
  coef = c(as.numeric(fit2_s1e$coefficients[1]), fit2_s1e_effects$estimate),
  se = c(as.numeric(fit2_s1e$std.error[1]), fit2_s1e_effects$std.error),
  pvalues = c(as.numeric(fit2_s1e$p.value[1]), fit2_s1e_effects$p.value),
  gof = c(as.numeric(summary(fit2_s1e)[9]), 
          as.numeric(summary(fit2_s1e)[10]), 
          as.integer(summary(fit2_s1e)[13]), 
          fit2_s1e_rmse),
  gof.names = c("R$^2$", "Adj. R$^2$", "Num. obs", "RMSE")
)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit2_s1e_effects_v2,
  custom.coef.names = 
    c("Intercept", "Control (Medium religiosity)", "Control (High religiosity)", 
                 "Control (Low religiosity)", "Fact-check (Medium religiosity)", 
                 "Fact-check (High religiosity)", "Fact-check (Low religiosity)"),
  caption = "Effect of fact-check on the belief that more contraception availability increases abortion
demand (1-to-4 scale)",
  caption.above = TRUE, 
  float.pos = "H",
  single.row = "TRUE")
```

```{r, include = FALSE, message = FALSE}
#Running model
fit3_s1e <- lm_robust(fc_3_belief_clean ~ Z_fc_3*attend_cleaned, data = abortion_s1_cleaned)
```

```{r, include = FALSE, message = FALSE}
#Creating texreg object

#IMPORTANT: We originally showed results via interaction terms but switched 
  #to showing group-specific effects below for clarity.
#These are based on the SAME model.
fit3_s1e_v2 <- texreg(fit3_s1e, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check", "High attendance", "Low attendance",
        "Control*High attendance", "Fact-check*High attendance", "Control*Low attendance", "Fact-check*Low attendance"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between high/low (vs. medium) religious attendance and fact-check of claim about 10-year-old terminating pregnancy (1-to-4 scale)",
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, warning = FALSE}
#Extracting RMSE value
fit3_s1e_rmse <- as.numeric(sub('.*RMSE\\s*&\\s*\\$([0-9\\.]+)\\$.*', '\\1', fit3_s1e_v2[1]))
```

```{r, include = FALSE, warning = FALSE}
#Getting effects of assignment conditions by religiosity
fit3_s1e_effects <- avg_comparisons(fit3_s1e, variables = "Z_fc_3", by = "attend_cleaned")
```

```{r, include = FALSE, warning = FALSE}
#Creating texreg object
fit3_s1e_effects_v2 <- createTexreg(
  coef.names = c("Intercept", "Control (Medium religiosity)", "Control (High religiosity)", 
                 "Control (Low religiosity)", "Fact-check (Medium religiosity)", 
                 "Fact-check (High religiosity)", "Fact-check (Low religiosity)"),
  coef = c(as.numeric(fit3_s1e$coefficients[1]), fit3_s1e_effects$estimate),
  se = c(as.numeric(fit3_s1e$std.error[1]), fit3_s1e_effects$std.error),
  pvalues = c(as.numeric(fit3_s1e$p.value[1]), fit3_s1e_effects$p.value),
  gof = c(as.numeric(summary(fit3_s1e)[9]), 
          as.numeric(summary(fit3_s1e)[10]), 
          as.integer(summary(fit3_s1e)[13]), 
          fit3_s1e_rmse),
  gof.names = c("R$^2$", "Adj. R$^2$", "Num. obs", "RMSE")
)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit3_s1e_effects_v2,
  custom.coef.names = 
    c("Intercept", "Control (Medium religiosity)", "Control (High religiosity)", 
                 "Control (Low religiosity)", "Fact-check (Medium religiosity)", 
                 "Fact-check (High religiosity)", "Fact-check (Low religiosity)"),
  caption = "Effect of fact-check on the belief that it’s not an abortion if a 10-year-old became
pregnant as a result of rape and terminated the pregnancy (1-to-4 scale)",
  caption.above = TRUE, 
  float.pos = "H",
  single.row = "TRUE")
```

## Regression tables: attitudinal beliefs

FC1 (Belief that abortion pills are dangerous and that 1 in 5 women will suffer a complication): Alliance Defending Freedom

FC2 (Belief that more contraception availability increases abortion demand): Planned Parenthood, Seth Gruber

FC3 (Belief that it's not an abortion if a 10-year-old became pregnant as a result of rape and terminated the pregnancy): Americans United For Life, Eric Swalwell

All three: PolitiFact

### Alliance Defending Freedom

```{r, echo = FALSE, results='asis'}
#Running model
fit4_s1 <- lm_robust(thermometer_1 ~ Z_fc_1, data = abortion_s1_cleaned)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit4_s1, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Fact-checking the claim that abortion pills are dangerous lowers opinions of Alliance Defending Freedom (0-to-100 scale)", 
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

### Seth Gruber

```{r, echo = FALSE, results='asis'}
#Running model
fit5_s1 <- lm_robust(thermometer_2 ~ Z_fc_2, data = abortion_s1_cleaned)
```


```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit5_s1, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Fact-checking the claim that contraception availability increases abortion demand lowers opinions of Seth Gruber (0-to-100 scale)", 
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

### Americans United For Life

```{r, echo = FALSE, results='asis'}
#Running model
fit6_s1 <- lm_robust(thermometer_3 ~ Z_fc_3, data = abortion_s1_cleaned)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit6_s1, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Fact-checking the claim about a 10-year-old terminating a \npregnancy has no effect on attitudes toward Americans United For Life (0-to-100 scale)", 
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

### Eric Swalwell

```{r, echo = FALSE, results='asis'}
#Running model
fit7_s1 <- lm_robust(thermometer_5 ~ Z_fc_3, data = abortion_s1_cleaned)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit7_s1, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Fact-checking the claim about a 10-year-old terminating a pregnancy has no effect on attitudes toward Eric Swalwell (0-to-100 scale)", 
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

### PolitiFact

```{r, echo = FALSE, results='asis'}
#Running models
fit8_s1a <- lm_robust(thermometer_6 ~ Z_fc_1, data = abortion_s1_cleaned)
fit8_s1b <- lm_robust(thermometer_6 ~ Z_fc_2, data = abortion_s1_cleaned)
fit8_s1c <- lm_robust(thermometer_6 ~ Z_fc_3, data = abortion_s1_cleaned)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit8_s1a, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Fact-checking the claim that abortion pills are dangerous improves attitudes toward PolitiFact (0-to-100 scale)", 
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit8_s1b, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Fact-checking the claim that contraception availability increases abortion demand has no effect on attitudes toward PolitiFact (0-to-100 scale)", 
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit8_s1c, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Fact-checking the claim about a 10-year-old terminating a 
pregnancy has no effect on attitudes toward PolitiFact (0-to-100 scale)", 
       caption.above = TRUE, float.pos = "H",
single.row = TRUE)
```

### Planned Parenthood

```{r, echo = FALSE, results='asis'}
#Running model
fit9_s1 <- lm_robust(thermometer_7 ~ Z_fc_2, data = abortion_s1_cleaned)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit9_s1, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Fact-checking that contraception availability increases abortion demand has no effect on attitudes toward Planned Parenthood (0-to-100 scale)", 
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

### Interactions with partisanship

```{r, include=FALSE, warning = FALSE}
#Creating model
fit4_s1_partisanship <- 
    lm_robust(thermometer_1 ~ Z_fc_1*pid_1_cleaned, 
    data = abortion_s1_cleaned)
```

```{r, include=FALSE, warning = FALSE}
#Creating texreg object

#IMPORTANT: We originally showed results via interaction terms but switched 
  #to showing group-specific effects below for clarity.
#These are based on the SAME model.
fit4_s1_partisanship_v2 <- texreg(fit4_s1_partisanship, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check", "Independent/Other", "Republican", 
      "Control*Independent/Other", "Fact-check*Independent/Other", "Control*Republican", "Fact-check*Republican"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between being a Republican/Independent (vs. being a Democrat) and fact-check of claim that abortion pills are dangerous on attitudes toward Alliance Defending Freedom (0-to-100)",
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, warning = FALSE}
#Extracting RMSE value
fit4_s1_partisanship_rmse <- as.numeric(sub('.*RMSE\\s*&\\s*\\$([0-9\\.]+)\\$.*', '\\1', fit4_s1_partisanship_v2[1]))
```

```{r, include = FALSE, warning = FALSE}
#Getting effects of assignment conditions by partisanship
fit4_s1_partisanship_effects <- avg_comparisons(fit4_s1_partisanship, variables = "Z_fc_1", by = "pid_1_cleaned")
```

```{r, include = FALSE, warning = FALSE}
#Creating texreg object
fit4_s1_partisanship_effects_v2 <- createTexreg(
  coef.names = c("Intercept", "Control (Democrats)", "Control (Independent/Other)", 
                 "Control (Republicans)", "Fact-check (Democrats)", 
                 "Fact-check (Independent/Other)", "Fact-check (Republicans)"),
  coef = c(as.numeric(fit4_s1_partisanship$coefficients[1]), fit4_s1_partisanship_effects$estimate),
  se = c(as.numeric(fit4_s1_partisanship$std.error[1]), fit4_s1_partisanship_effects$std.error),
  pvalues = c(as.numeric(fit4_s1_partisanship$p.value[1]), fit4_s1_partisanship_effects$p.value),
  gof = c(as.numeric(summary(fit4_s1_partisanship)[9]), 
          as.numeric(summary(fit4_s1_partisanship)[10]), 
          as.integer(summary(fit4_s1_partisanship)[13]), 
          fit4_s1_partisanship_rmse),
  gof.names = c("R$^2$", "Adj. R$^2$", "Num. obs", "RMSE")
)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit4_s1_partisanship_effects_v2,
  custom.coef.names = 
    c("Intercept", "Control (Democrats)", "Control (Independent/Other)", 
                 "Control (Republicans)", "Fact-check (Democrats)", 
                 "Fact-check (Independent/Other)", "Fact-check (Republicans)"),
  caption = "Effect of fact-check of the claim that abortion pills are dangerous on attitudes toward Alliance Defending Freedom (0-to-100)",
  caption.above = TRUE, 
  float.pos = "H",
  single.row = "TRUE")
```

```{r, include=FALSE, warning = FALSE}
#Creating model
fit5_s1_partisanship <- 
    lm_robust(thermometer_2 ~ Z_fc_2*pid_1_cleaned, 
    data = abortion_s1_cleaned)
```

```{r, include=FALSE, warning = FALSE}
#Creating texreg object

#IMPORTANT: We originally showed results via interaction terms but switched 
  #to showing group-specific effects below for clarity.
#These are based on the SAME model.
fit5_s1_partisanship_v2 <- texreg(fit5_s1_partisanship, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check", "Independent/Other", "Republican", 
      "Control*Independent/Other", "Fact-check*Independent/Other", "Control*Republican", "Fact-check*Republican"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between being a Republican/Independent (vs. being a Democrat) and fact-check of claim that contraception availability increases abortion demand on attitudes toward Seth Gruber (0-to-100)",
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, warning = FALSE}
#Extracting RMSE value
fit5_s1_partisanship_rmse <- as.numeric(sub('.*RMSE\\s*&\\s*\\$([0-9\\.]+)\\$.*', '\\1', fit5_s1_partisanship_v2[1]))
```

```{r, include = FALSE, warning = FALSE}
#Getting effects of assignment conditions by partisanship
fit5_s1_partisanship_effects <- avg_comparisons(fit5_s1_partisanship, variables = "Z_fc_2", by = "pid_1_cleaned")
```

```{r, include = FALSE, warning = FALSE}
#Creating texreg object
fit5_s1_partisanship_effects_v2 <- createTexreg(
  coef.names = c("Intercept", "Control (Democrats)", "Control (Independent/Other)", 
                 "Control (Republicans)", "Fact-check (Democrats)", 
                 "Fact-check (Independent/Other)", "Fact-check (Republicans)"),
  coef = c(as.numeric(fit5_s1_partisanship$coefficients[1]), fit5_s1_partisanship_effects$estimate),
  se = c(as.numeric(fit5_s1_partisanship$std.error[1]), fit5_s1_partisanship_effects$std.error),
  pvalues = c(as.numeric(fit5_s1_partisanship$p.value[1]), fit5_s1_partisanship_effects$p.value),
  gof = c(as.numeric(summary(fit5_s1_partisanship)[9]), 
          as.numeric(summary(fit5_s1_partisanship)[10]), 
          as.integer(summary(fit5_s1_partisanship)[13]), 
          fit5_s1_partisanship_rmse),
  gof.names = c("R$^2$", "Adj. R$^2$", "Num. obs", "RMSE")
)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit5_s1_partisanship_effects_v2,
  custom.coef.names = 
    c("Intercept", "Control (Democrats)", "Control (Independent/Other)", 
                 "Control (Republicans)", "Fact-check (Democrats)", 
                 "Fact-check (Independent/Other)", "Fact-check (Republicans)"),
  caption = "Effect of fact-check of the claim that contraception availability increases abortion demand on attitudes toward Seth Gruber (0-to-100)",
  caption.above = TRUE, 
  float.pos = "H",
  single.row = "TRUE")
```

```{r, include=FALSE, warning = FALSE}
#Creating model
fit6_s1_partisanship <- 
    lm_robust(thermometer_3 ~ Z_fc_3*pid_1_cleaned, 
    data = abortion_s1_cleaned)
```

```{r, include=FALSE, warning = FALSE}
#Creating texreg object

#IMPORTANT: We originally showed results via interaction terms but switched 
  #to showing group-specific effects below for clarity.
#These are based on the SAME model.
fit6_s1_partisanship_v2 <- texreg(fit6_s1_partisanship, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check", "Independent/Other", "Republican", 
      "Control*Independent/Other", "Fact-check*Independent/Other", "Control*Republican", "Fact-check*Republican"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between being a Republican/Independent (vs. being a Democrat) and fact-check of belief that it’s not an abortion if a 10-year-old became
pregnant as a result of rape and terminated the pregnancy on attitudes toward Americans United For Life (0-to-100)",
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, warning = FALSE}
#Extracting RMSE value
fit6_s1_partisanship_rmse <- as.numeric(sub('.*RMSE\\s*&\\s*\\$([0-9\\.]+)\\$.*', '\\1', fit6_s1_partisanship_v2[1]))
```

```{r, include = FALSE, warning = FALSE}
#Getting effects of assignment conditions by partisanship
fit6_s1_partisanship_effects <- avg_comparisons(fit6_s1_partisanship, variables = "Z_fc_3", by = "pid_1_cleaned")
```

```{r, include = FALSE, warning = FALSE}
#Creating texreg object
fit6_s1_partisanship_effects_v2 <- createTexreg(
  coef.names = c("Intercept", "Control (Democrats)", "Control (Independent/Other)", 
                 "Control (Republicans)", "Fact-check (Democrats)", 
                 "Fact-check (Independent/Other)", "Fact-check (Republicans)"),
  coef = c(as.numeric(fit6_s1_partisanship$coefficients[1]), fit6_s1_partisanship_effects$estimate),
  se = c(as.numeric(fit6_s1_partisanship$std.error[1]), fit6_s1_partisanship_effects$std.error),
  pvalues = c(as.numeric(fit6_s1_partisanship$p.value[1]), fit6_s1_partisanship_effects$p.value),
  gof = c(as.numeric(summary(fit6_s1_partisanship)[9]), 
          as.numeric(summary(fit6_s1_partisanship)[10]), 
          as.integer(summary(fit6_s1_partisanship)[13]), 
          fit6_s1_partisanship_rmse),
  gof.names = c("R$^2$", "Adj. R$^2$", "Num. obs", "RMSE")
)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit6_s1_partisanship_effects_v2,
  custom.coef.names = 
    c("Intercept", "Control (Democrats)", "Control (Independent/Other)", 
                 "Control (Republicans)", "Fact-check (Democrats)", 
                 "Fact-check (Independent/Other)", "Fact-check (Republicans)"),
  caption = "Effect of fact-check of the claim about a pregnant 10-year-old on attitudes toward Americans United For Life (0-to-100)",
  caption.above = TRUE, 
  float.pos = "H",
  single.row = "TRUE")
```

### Interactions with religiosity

```{r, include=FALSE, warning = FALSE}
#Creating model
fit4_s1_religiosity <- 
    lm_robust(thermometer_1 ~ Z_fc_1*attend_cleaned, 
    data = abortion_s1_cleaned)
```

```{r, include=FALSE, warning = FALSE}
#Creating texreg object

#IMPORTANT: We originally showed results via interaction terms but switched 
  #to showing group-specific effects below for clarity.
#These are based on the SAME model.
fit4_s1_religiosity_v2 <- texreg(fit4_s1_religiosity, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check", "High attendance", "Low attendance", 
      "Control*High attendance", "Fact-check*High attendance", "Control*Low attendance", "Fact-check*Low attendance"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between having high/low (vs. medium) religious attendance and fact-check of claim that abortion pills are dangerous on attitudes toward Alliance Defending Freedom (0-to-100)",
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, warning = FALSE}
#Extracting RMSE value
fit4_s1_religiosity_rmse <- as.numeric(sub('.*RMSE\\s*&\\s*\\$([0-9\\.]+)\\$.*', '\\1', fit4_s1_religiosity_v2[1]))
```

```{r, include = FALSE, warning = FALSE}
#Getting effects of assignment conditions by partisanship
fit4_s1_religiosity_effects <- avg_comparisons(fit4_s1_religiosity, variables = "Z_fc_1", by = "attend_cleaned")
```

```{r, include = FALSE, warning = FALSE}
#Creating texreg object
fit4_s1_religiosity_effects_v2 <- createTexreg(
  coef.names = c("Intercept", "Control (Medium religiosity)", "Control (High religiosity)", 
                 "Control (Low religiosity)", "Fact-check (Medium religiosity)", 
                 "Fact-check (High religiosity)", "Fact-check (Low religiosity)"),
  coef = c(as.numeric(fit4_s1_religiosity$coefficients[1]), fit4_s1_religiosity_effects$estimate),
  se = c(as.numeric(fit4_s1_religiosity$std.error[1]), fit4_s1_religiosity_effects$std.error),
  pvalues = c(as.numeric(fit4_s1_religiosity$p.value[1]), fit4_s1_religiosity_effects$p.value),
  gof = c(as.numeric(summary(fit4_s1_religiosity)[9]), 
          as.numeric(summary(fit4_s1_religiosity)[10]), 
          as.integer(summary(fit4_s1_religiosity)[13]), 
          fit4_s1_religiosity_rmse),
  gof.names = c("R$^2$", "Adj. R$^2$", "Num. obs", "RMSE")
)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit4_s1_religiosity_effects_v2,
  custom.coef.names = 
    c("Intercept", "Control (Medium religiosity)", "Control (High religiosity)", 
                 "Control (Low religiosity)", "Fact-check (Medium religiosity)", 
                 "Fact-check (High religiosity)", "Fact-check (Low religiosity)"),
  caption = "Effect of fact-check of the claim that abortion pills are dangerous on attitudes toward Alliance Defending Freedom (0-to-100)",
  caption.above = TRUE, 
  float.pos = "H",
  single.row = "TRUE")
```

```{r, include=FALSE, warning = FALSE}
#Creating model
fit5_s1_religiosity <- 
    lm_robust(thermometer_2 ~ Z_fc_2*attend_cleaned, 
    data = abortion_s1_cleaned)
```

```{r, include=FALSE, warning = FALSE}
#Creating texreg object

#IMPORTANT: We originally showed results via interaction terms but switched 
  #to showing group-specific effects below for clarity.
#These are based on the SAME model.
fit5_s1_religiosity_v2 <- texreg(fit5_s1_religiosity, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check", "High attendance", "Low attendance", 
      "Control*High attendance", "Fact-check*High attendance", "Control*Low attendance", "Fact-check*Low attendance"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between having high/low (vs. medium) religious attendance and fact-check of claim that contraception availability increases abortion demand on attitudes toward Seth Gruber (0-to-100)",
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, warning = FALSE}
#Extracting RMSE value
fit5_s1_religiosity_rmse <- as.numeric(sub('.*RMSE\\s*&\\s*\\$([0-9\\.]+)\\$.*', '\\1', fit5_s1_religiosity_v2[1]))
```

```{r, include = FALSE, warning = FALSE}
#Getting effects of assignment conditions by partisanship
fit5_s1_religiosity_effects <- avg_comparisons(fit5_s1_religiosity, variables = "Z_fc_2", by = "attend_cleaned")
```

```{r, include = FALSE, warning = FALSE}
#Creating texreg object
fit5_s1_religiosity_effects_v2 <- createTexreg(
  coef.names = c("Intercept", "Control (Medium religiosity)", "Control (High religiosity)", 
                 "Control (Low religiosity)", "Fact-check (Medium religiosity)", 
                 "Fact-check (High religiosity)", "Fact-check (Low religiosity)"),
  coef = c(as.numeric(fit5_s1_religiosity$coefficients[1]), fit5_s1_religiosity_effects$estimate),
  se = c(as.numeric(fit5_s1_religiosity$std.error[1]), fit5_s1_religiosity_effects$std.error),
  pvalues = c(as.numeric(fit5_s1_religiosity$p.value[1]), fit5_s1_religiosity_effects$p.value),
  gof = c(as.numeric(summary(fit5_s1_religiosity)[9]), 
          as.numeric(summary(fit5_s1_religiosity)[10]), 
          as.integer(summary(fit5_s1_religiosity)[13]), 
          fit5_s1_religiosity_rmse),
  gof.names = c("R$^2$", "Adj. R$^2$", "Num. obs", "RMSE")
)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit5_s1_religiosity_effects_v2,
  custom.coef.names = 
    c("Intercept", "Control (Medium religiosity)", "Control (High religiosity)", 
                 "Control (Low religiosity)", "Fact-check (Medium religiosity)", 
                 "Fact-check (High religiosity)", "Fact-check (Low religiosity)"),
  caption = "Effect of fact-check of the claim that contraception availability increases abortion demand on attitudes toward Seth Gruber (0-to-100)",
  caption.above = TRUE, 
  float.pos = "H",
  single.row = "TRUE")
```

```{r, include=FALSE, warning = FALSE}
#Creating model
fit6_s1_religiosity <- 
    lm_robust(thermometer_3 ~ Z_fc_3*attend_cleaned, 
    data = abortion_s1_cleaned)
```

```{r, include=FALSE, warning = FALSE}
#Creating texreg object

#IMPORTANT: We originally showed results via interaction terms but switched 
  #to showing group-specific effects below for clarity.
#These are based on the SAME model.
fit6_s1_religiosity_v2 <- texreg(fit6_s1_religiosity, include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check", "High attendance", "Low attendance", 
      "Control*High attendance", "Fact-check*High attendance", "Control*Low attendance", "Fact-check*Low attendance"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between having high/low (vs. medium) religious attendance and fact-check of belief that it’s not an abortion if a 10-year-old became
pregnant as a result of rape and terminated the pregnancy on attitudes toward Americans United For Life (0-to-100)",
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE)
```

```{r, include = FALSE, warning = FALSE}
#Extracting RMSE value
fit6_s1_religiosity_rmse <- as.numeric(sub('.*RMSE\\s*&\\s*\\$([0-9\\.]+)\\$.*', '\\1', fit6_s1_religiosity_v2[1]))
```

```{r, include = FALSE, warning = FALSE}
#Getting effects of assignment conditions by partisanship
fit6_s1_religiosity_effects <- avg_comparisons(fit6_s1_religiosity, variables = "Z_fc_3", by = "attend_cleaned")
```

```{r, include = FALSE, warning = FALSE}
#Creating texreg object
fit6_s1_religiosity_effects_v2 <- createTexreg(
  coef.names = c("Intercept", "Control (Medium religiosity)", "Control (High religiosity)", 
                 "Control (Low religiosity)", "Fact-check (Medium religiosity)", 
                 "Fact-check (High religiosity)", "Fact-check (Low religiosity)"),
  coef = c(as.numeric(fit6_s1_religiosity$coefficients[1]), fit6_s1_religiosity_effects$estimate),
  se = c(as.numeric(fit6_s1_religiosity$std.error[1]), fit6_s1_religiosity_effects$std.error),
  pvalues = c(as.numeric(fit6_s1_religiosity$p.value[1]), fit6_s1_religiosity_effects$p.value),
  gof = c(as.numeric(summary(fit6_s1_religiosity)[9]), 
          as.numeric(summary(fit6_s1_religiosity)[10]), 
          as.integer(summary(fit6_s1_religiosity)[13]), 
          fit6_s1_religiosity_rmse),
  gof.names = c("R$^2$", "Adj. R$^2$", "Num. obs", "RMSE")
)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(fit6_s1_religiosity_effects_v2,
  custom.coef.names = 
    c("Intercept", "Control (Medium religiosity)", "Control (High religiosity)", 
                 "Control (Low religiosity)", "Fact-check (Medium religiosity)", 
                 "Fact-check (High religiosity)", "Fact-check (Low religiosity)"),
  caption = "Effect of fact-check of the claim about a pregnant 10-year-old on attitudes toward Americans United For Life (0-to-100)",
  caption.above = TRUE, 
  float.pos = "H",
  single.row = "TRUE")
```

## Attitudes graph

```{r, include = FALSE, message = FALSE}
#Creating data frame with marginal effects
#Rationale: we're about to create a graph looking at the effects of 
  #fact-checks on attitudes
ma_fit4_s1 <- margins(fit4_s1)
ma_2_fit4_s1 <- summary(ma_fit4_s1)
ma_2_fit4_s1$var <- ma_2_fit4_s1$factor
ma_2_fit4_s1$var[1] <- 1
ma_2_fit4_s1$var[2] <- 2
ma_2_fit4_s1$var <- as.numeric(ma_2_fit4_s1$var)

ma_fit5_s1 <- margins(fit5_s1)
ma_2_fit5_s1 <- summary(ma_fit5_s1)
ma_2_fit5_s1$var <- ma_2_fit5_s1$factor
ma_2_fit5_s1$var[1] <- 1
ma_2_fit5_s1$var[2] <- 2
ma_2_fit5_s1$var <- as.numeric(ma_2_fit5_s1$var)

ma_fit6_s1 <- margins(fit6_s1)
ma_2_fit6_s1 <- summary(ma_fit6_s1)
ma_2_fit6_s1$var <- ma_2_fit6_s1$factor
ma_2_fit6_s1$var[1] <- 1
ma_2_fit6_s1$var[2] <- 2
ma_2_fit6_s1$var <- as.numeric(ma_2_fit6_s1$var)

ma_combined_2_s1 <- 
  rbind(ma_2_fit4_s1[2,], ma_2_fit5_s1[2,], ma_2_fit6_s1[2,])

ma_combined_2_s1$var <- 1:3
ma_combined_2_s1$Effect <- "Fact-check"
ma_combined_2_s1$factor <- NULL

ma_combined_3_s1 <- 
  rbind(ma_2_fit4_s1[1,], ma_2_fit5_s1[1,], ma_2_fit6_s1[1,])

ma_combined_3_s1$AME <- -ma_combined_3_s1$AME
ma_combined_3_s1$lower <- -ma_combined_3_s1$lower
ma_combined_3_s1$upper <- -ma_combined_3_s1$upper

ma_combined_3_s1$var <- 1:3
ma_combined_3_s1$Effect <- "Misinformation"
ma_combined_3_s1$factor <- NULL

ma_combined_graph4_s1 <-
  rbind(ma_combined_2_s1, ma_combined_3_s1)
colnames(ma_combined_graph4_s1) <-
  c("AME", "SE", "z", "p", "lower", "upper", "var", "Effect")
```

```{r, include = FALSE, message = FALSE}
#Creating Study 1 graph looking at the effects of fact-checks on attitudes
ma_combined_graph4_s1$var[
  ma_combined_graph4_s1$var == 1 & ma_combined_graph4_s1$Effect == "Fact-check"
  ] <- 0.975
ma_combined_graph4_s1$var[
  ma_combined_graph4_s1$var == 2 & ma_combined_graph4_s1$Effect == "Fact-check"
  ] <- 1.975
ma_combined_graph4_s1$var[
  ma_combined_graph4_s1$var == 3 & ma_combined_graph4_s1$Effect == "Fact-check"
  ] <- 2.975

ma_combined_graph4_s1$var[
  ma_combined_graph4_s1$var == 1 & ma_combined_graph4_s1$Effect == "Misinformation"
  ] <- 1.025
ma_combined_graph4_s1$var[
  ma_combined_graph4_s1$var == 2 & ma_combined_graph4_s1$Effect == "Misinformation"
  ] <- 2.025
ma_combined_graph4_s1$var[
  ma_combined_graph4_s1$var == 3 & ma_combined_graph4_s1$Effect == "Misinformation"
  ] <- 3.025

ma_combined_graph4_s1$Effect <- 
  factor(ma_combined_graph4_s1$Effect,
         levels = c("Misinformation", "Fact-check"))

attitudes_study1_graph <- ma_combined_graph4_s1 %>%
  ggplot(aes(x=var, y=AME, color=Effect)) +
  geom_point() +
  geom_segment(aes(x = var, y = lower, xend = var, yend = upper)) +
  scale_x_continuous(breaks=c(1:3), 
      expand = expansion(mult = 0.2),
      labels=c("Alliance Defending \nFreedom", "Seth Gruber", "Americans United \nFor Life")) +
  geom_hline(yintercept = 0, linetype = "dashed", color = "purple") +
  xlab("") +
  ylab("Average effect on \nfeeling thermometer") +
  #labs(title = "Study 1") +
  scale_color_manual(
    values = c(
      "Misinformation" = "red",
      "Fact-check" = "blue"
    )) +
  theme_classic() +
  theme(axis.text.x = element_blank()) +
  #theme(legend.position = "none") +
  ylim(-12,6)

#Loading in Study 2 data frame with marginal effects
load("ma_combined_attitudes_s2_v2.RData")

ma_combined_s2_v2$var[
  ma_combined_s2_v2$var == 1 & ma_combined_s2_v2$Effect == "Fact-check"
  ] <- 0.975
ma_combined_s2_v2$var[
  ma_combined_s2_v2$var == 2 & ma_combined_s2_v2$Effect == "Fact-check"
  ] <- 1.975
ma_combined_s2_v2$var[
  ma_combined_s2_v2$var == 3 & ma_combined_s2_v2$Effect == "Fact-check"
  ] <- 2.975

ma_combined_s2_v2$var[
  ma_combined_s2_v2$var == 1 & ma_combined_s2_v2$Effect == "Misinformation"
  ] <- 1.025
ma_combined_s2_v2$var[
  ma_combined_s2_v2$var == 2 & ma_combined_s2_v2$Effect == "Misinformation"
  ] <- 2.025
ma_combined_s2_v2$var[
  ma_combined_s2_v2$var == 3 & ma_combined_s2_v2$Effect == "Misinformation"
  ] <- 3.025

ma_combined_s2_v2$Effect <- 
  factor(ma_combined_s2_v2$Effect,
         levels = c("Misinformation", "Fact-check"))

#Creating Study 2 graph looking at the effects of fact-checks on attitudes
attitudes_study2_graph <- ma_combined_s2_v2 %>%
  ggplot(aes(x=var, y=AME, color=Effect)) +
  geom_point() +
  geom_segment(aes(x = var, y = lower, xend = var, yend = upper)) +
  scale_x_continuous(breaks=c(1:3), 
      expand = expansion(mult = 0.3),
      labels=c("Alliance Defending \nFreedom", 
        "Seth Gruber", 
        "Americans United \nFor Life")) +
  geom_hline(yintercept = 0, linetype = "dashed", color = "purple") +
  xlab("Feeling thermometer rating") +
  ylab("Average effect on \nfeeling thermometer") +
  #labs(title = "Study 2") +
  scale_color_manual(
    values = c(
      "Misinformation" = "red",
      "Fact-check" = "blue"
    )) +
  theme_classic() +
  #theme(legend.position = "none") +
  ylim(-12,6)
```

```{r, echo = FALSE}
#Displaying both the Study 1 and Study 2 attitude graphs
ggarrange(attitudes_study1_graph, attitudes_study2_graph, 
  labels = c("Study 1", "Study 2"),
  ncol = 1, nrow = 2,
  hjust=-5)
```

## Balance tables

```{r, include = FALSE, message = FALSE}
#Selecting only some variables and doing some recoding
abortion_s1_v2 <-
  abortion_s1_cleaned %>%
  select(Z_fc_1, Z_fc_2, Z_fc_3, age, education, income, gender, race,
    pid_dem, pid_indep, pid_rep)

#Age
abortion_s1_v2$age_v2 <- 2023-as.numeric(abortion_s1_v2$age)
#Education
abortion_s1_v2$college_grad <-
  ifelse(abortion_s1_v2$education %in% c("Bachelor's degree in college (4-year)",
                                      "Doctoral degree",
                                      "Master's degree",
                                      "Professional degree (JD, MD)"),
  1, 0)
#Gender
abortion_s1_v2$male <-
  ifelse(abortion_s1_v2$gender == "Man", 1, 0)
#Income
abortion_s1_v2$income_v2 <- trimmed_string <- trimws(abortion_s1_v2$income)
abortion_s1_v2$income_90000 <- NA
abortion_s1_v2$income_90000[
  abortion_s1_v2$income_v2 %in% c("$30,000-$59,999", "$60,000-$89,999", "Less than $30,000")
  ] <- 0
abortion_s1_v2$income_90000[
  abortion_s1_v2$income_v2 %in% c("$120,000-$149,999", "$150,000-$179,999",
    "$180,000-$209,999", "$210,000-$249,999", "$250,000 and above",
    "$90,000-$119,999")
  ] <- 1
#Race
abortion_s1_v2$white <-
  ifelse(abortion_s1_v2$race == "White or Caucasian", 1, 0)
#Partisanship
  #Creating cleaned PID variable
  #1 (Strong Democrat) to 7 (Strong Republican)
abortion_s1_v2$pid_cleaned <- NA
abortion_s1_v2$pid_cleaned[
  abortion_s1_v2$pid_dem == "Strong Democrat"
  ] <- 1
abortion_s1_v2$pid_cleaned[
  abortion_s1_v2$pid_dem == "Not very strong Democrat"
  ] <- 2
abortion_s1_v2$pid_cleaned[
  abortion_s1_v2$pid_indep == "Closer to the Democratic Party"
  ] <- 3
abortion_s1_v2$pid_cleaned[
  abortion_s1_v2$pid_indep == "Neither"
  ] <- 4
abortion_s1_v2$pid_cleaned[
  abortion_s1_v2$pid_indep == "Closer to the Republican Party"
  ] <- 5
abortion_s1_v2$pid_cleaned[
  abortion_s1_v2$pid_rep == "Not very strong Republican"
  ] <- 6
abortion_s1_v2$pid_cleaned[
  abortion_s1_v2$pid_rep == "Strong Republican"
  ] <- 7
```

First fact-check (abortion pills):

```{r, include = FALSE, message = FALSE}
#Selecting only some variables (for FC1 balance table)
abortion_s1_fc1 <- abortion_s1_v2 %>%
  select(Z_fc_1, age_v2, male, white, college_grad, income_90000, pid_cleaned)
#Renaming columns
colnames(abortion_s1_fc1) <-
  c("Abortion pills FC", "Age", "Share who are male", 
    "Share who are non-Hispanic White", 
    "Share who are college graduates", 
    "Share who have household incomes of $90,000+",
    "Partisanship (7-point scale)")
#Recoding `Abortion pills FC` variable
abortion_s1_fc1$`Abortion pills FC` <-
  as.character(abortion_s1_fc1$`Abortion pills FC`)
abortion_s1_fc1$`Abortion pills FC`[
  abortion_s1_fc1$`Abortion pills FC` == "control"
  ] <- "Control"
abortion_s1_fc1$`Abortion pills FC`[
  abortion_s1_fc1$`Abortion pills FC` == "factcheck"
  ] <- "Fact-check"
abortion_s1_fc1$`Abortion pills FC`[
  abortion_s1_fc1$`Abortion pills FC` == "misinformation"
  ] <- "Misinformation"
```

```{r, include = FALSE, message = FALSE}
#Creating FC1 balance table
abortion_s1_fc1_v2 <- balance_table(abortion_s1_fc1, "Abortion pills FC")
colnames(abortion_s1_fc1_v2) <- c("Variable", "Control", "Fact-check", "Misinfo", "p-value (c vs fc)", "p-value (c vs mis)")
```

```{r, echo = FALSE, results='asis'}
#Displaying FC1 balance table
print(xtable(abortion_s1_fc1_v2), size = "tiny")
```

Second fact-check (contraception):

```{r, include = FALSE, message = FALSE}
#Selecting only some variables (for FC2 balance table)
abortion_s1_fc2 <- abortion_s1_v2 %>%
  select(Z_fc_2, age_v2, male, white, college_grad, income_90000, pid_cleaned)
#Renaming columns
colnames(abortion_s1_fc2) <-
  c("Contraception FC", "Age", "Share who are male", 
    "Share who are non-Hispanic White", 
    "Share who are college graduates", 
    "Share who have household incomes of $90,000+",
    "Partisanship (7-point scale)")
#Recoding `Contraception FC` variable
abortion_s1_fc2$`Contraception FC` <-
  as.character(abortion_s1_fc2$`Contraception FC`)
abortion_s1_fc2$`Contraception FC`[
  abortion_s1_fc2$`Contraception FC` == "control"
  ] <- "Control"
abortion_s1_fc2$`Contraception FC`[
  abortion_s1_fc2$`Contraception FC` == "factcheck"
  ] <- "Fact-check"
abortion_s1_fc2$`Contraception FC`[
  abortion_s1_fc2$`Contraception FC` == "misinformation"
  ] <- "Misinformation"
```

```{r, include = FALSE, message = FALSE}
#Creating FC2 balance table
abortion_s1_fc2_v2 <- balance_table(abortion_s1_fc2, "Contraception FC")
colnames(abortion_s1_fc2_v2) <- c("Variable", "Control", "Fact-check", "Misinfo", "p-value (c vs fc)", "p-value (c vs mis)")
```


```{r, echo = FALSE, results='asis'}
#Displaying FC2 balance table
print(xtable(abortion_s1_fc2_v2), size = "tiny")
```

Third fact-check (10-year-old):

```{r, include = FALSE, message = FALSE}
#Selecting only some variables (for FC3 balance table)
abortion_s1_fc3 <- abortion_s1_v2 %>%
  select(Z_fc_3, age_v2, male, white, college_grad, income_90000, pid_cleaned)
#Renaming columns
colnames(abortion_s1_fc3) <-
  c("10-year old FC", "Age", "Share who are male", 
    "Share who are non-Hispanic White", 
    "Share who are college graduates", 
    "Share who have household incomes of $90,000+",
    "Partisanship (7-point scale)")
#Recoding `10-year old FC` variable
abortion_s1_fc3$`10-year old FC` <-
  as.character(abortion_s1_fc3$`10-year old FC`)
abortion_s1_fc3$`10-year old FC`[
  abortion_s1_fc3$`10-year old FC` == "control"
  ] <- "Control"
abortion_s1_fc3$`10-year old FC`[
  abortion_s1_fc3$`10-year old FC` == "factcheck"
  ] <- "Fact-check"
abortion_s1_fc3$`10-year old FC`[
  abortion_s1_fc3$`10-year old FC` == "misinformation"
  ] <- "Misinformation"
```

```{r, include = FALSE, message = FALSE}
#Creating FC3 balance table
abortion_s1_fc3_v2 <- balance_table(abortion_s1_fc3, "10-year old FC")
colnames(abortion_s1_fc3_v2) <- c("Variable", "Control", "Fact-check", "Misinfo", "p-value (c vs fc)", "p-value (c vs mis)")
```

\newpage

```{r, echo = FALSE, results='asis'}
#Displaying FC3 balance table
print(xtable(abortion_s1_fc3_v2), size = "tiny")
```

# Pooling Wave 1 and Wave 2 data: checking for heterogeneous effects

```{r, include = FALSE, message = FALSE}
#Creating variables that I'll use for this analysis
abortion_s1_cleaned$attend_cleaned <- "Low"
abortion_s1_cleaned$attend_cleaned[
  abortion_s1_cleaned$attendance == "A few times a year"
  ] <- "Medium"
abortion_s1_cleaned$attend_cleaned[
  abortion_s1_cleaned$attendance == "Once or twice a month"
  ] <- "Medium"
abortion_s1_cleaned$attend_cleaned[
  abortion_s1_cleaned$attendance == "Once a week"
  ] <- "High"
abortion_s1_cleaned$attend_cleaned[
  abortion_s1_cleaned$attendance == "More than once a week"
  ] <- "High"
abortion_s1_cleaned$attend_cleaned <-
  as.factor(abortion_s1_cleaned$attend_cleaned)
abortion_s1_cleaned$attend_cleaned <- 
  relevel(abortion_s1_cleaned$attend_cleaned, ref="Medium")
```


```{r, include = FALSE, message = FALSE}
#Creating variables that I'll use for this analysis
abortion_s1_cleaned$male <-
  ifelse(abortion_s1_cleaned$gender == "Man", 1, 0)

abortion_s1_cleaned$college_grad <-
  ifelse(abortion_s1_cleaned$education %in% c("Bachelor's degree in college (4-year)",
    "Doctoral degree", "Master's degree", "Professional degree (JD, MD)"), 1, 0)

abortion_s1_cleaned$age_cleaned <- 2023-abortion_s1_cleaned$age

abortion_s1_cleaned$relig_affiliated <-
   ifelse(
    abortion_s1_cleaned$religion %in% c("Buddhist", "Hindu", "Jewish", "Mormon", "Muslim", 
    "Orthodox, such as Greek or Russian Orthodox", "Protestant",
    "Roman Catholic", "Something else"), 1, 0
  )

```

```{r, include = FALSE, message = FALSE}
# Setting up data for pooled data/heterogeneous effects analysis
pooled_analysis_study1 <-
  abortion_s1_cleaned %>%
  dplyr::select(thermometer_1, Z_fc_1,
                thermometer_2, Z_fc_2,
                thermometer_3, Z_fc_3,
                pid_1_cleaned, male, college_grad, age_cleaned,
                relig_affiliated, attend_cleaned)
pooled_analysis_study1$study <- "study1"
```


```{r, include = FALSE, message = FALSE}
#Reading in some Study 2 data for the pooled analysis
load("pooled_analysis_study2.RData")

#Dropping this variable
pooled_analysis_study2$non_hisp_white <- NULL
```

```{r, include = FALSE, message = FALSE}
#Pooling the Study 1 and Study 2 data together
colnames(pooled_analysis_study1) <-
  c("thermometer_1", "fc_1", "thermometer_2", "fc_2", "thermometer_3", "fc_3",
    "pid_cleaned", "male", "college_grad", "age", "relig_affiliated", "attend_cleaned", "study")
colnames(pooled_analysis_study2) <-
  c("thermometer_1", "fc_1", "thermometer_2", "fc_2", "thermometer_3", "fc_3",
    "pid_cleaned", "male", "college_grad", "age", "relig_affiliated", "attend_cleaned", "study")

#Temporarily making factor variables character variables
#That way, I'll make the rbind process easier
pooled_analysis_study1$pid_cleaned <- as.character(pooled_analysis_study1$pid_cleaned)
pooled_analysis_study2$pid_cleaned <- as.character(pooled_analysis_study2$pid_cleaned)
pooled_analysis_study1$attend_cleaned <- as.character(pooled_analysis_study1$attend_cleaned)
pooled_analysis_study2$attend_cleaned <- as.character(pooled_analysis_study2$attend_cleaned)
pooled_analysis_study1$fc_1 <- as.character(pooled_analysis_study1$fc_1)
pooled_analysis_study2$fc_1 <- as.character(pooled_analysis_study2$fc_1)
pooled_analysis_study1$fc_2 <- as.character(pooled_analysis_study1$fc_2)
pooled_analysis_study2$fc_2 <- as.character(pooled_analysis_study2$fc_2)
pooled_analysis_study1$fc_3 <- as.character(pooled_analysis_study1$fc_3)
pooled_analysis_study2$fc_3 <- as.character(pooled_analysis_study2$fc_3)

pooled_analysis <- rbind(pooled_analysis_study1, pooled_analysis_study2)
```

```{r, include = FALSE, message = FALSE}
#Recoding various variables to be consistent between the two studies
pooled_analysis$fc_1[
  pooled_analysis$fc_1 %in% c("misinformation", "mis")
  ] <- "misinformation"
pooled_analysis$fc_1[
  pooled_analysis$fc_1 %in% c("control", "c")
  ] <- "control"
pooled_analysis$fc_1[
  pooled_analysis$fc_1 %in% c("factcheck", "fc")
  ] <- "factcheck"

pooled_analysis$fc_2[
  pooled_analysis$fc_2 %in% c("misinformation", "mis")
  ] <- "misinformation"
pooled_analysis$fc_2[
  pooled_analysis$fc_2 %in% c("control", "c")
  ] <- "control"
pooled_analysis$fc_2[
  pooled_analysis$fc_2 %in% c("factcheck", "fc")
  ] <- "factcheck"

pooled_analysis$fc_3[
  pooled_analysis$fc_3 %in% c("misinformation", "mis")
  ] <- "misinformation"
pooled_analysis$fc_3[
  pooled_analysis$fc_3 %in% c("control", "c")
  ] <- "control"
pooled_analysis$fc_3[
  pooled_analysis$fc_3 %in% c("factcheck", "fc")
  ] <- "factcheck"

pooled_analysis$pid_cleaned[
  pooled_analysis$pid_cleaned %in% c("1", "2")
  ] <- "Democrat"
pooled_analysis$pid_cleaned[
  pooled_analysis$pid_cleaned %in% c("3", "4", "5")
  ] <- "Independent/Other"
pooled_analysis$pid_cleaned[
  pooled_analysis$pid_cleaned %in% c("6", "7")
  ] <- "Republican"
```

```{r, include = FALSE, message = FALSE}
#Making factor variables factors again
pooled_analysis$pid_cleaned <-
  as.factor(pooled_analysis$pid_cleaned)
pooled_analysis$pid_cleaned <- 
  relevel(pooled_analysis$pid_cleaned, ref="Democrat")

pooled_analysis$attend_cleaned <-
  as.factor(pooled_analysis$attend_cleaned)
pooled_analysis$attend_cleaned <- 
  relevel(pooled_analysis$attend_cleaned, ref="Medium")

pooled_analysis$fc_1 <-
  as.factor(pooled_analysis$fc_1)
pooled_analysis$fc_1 <- 
  relevel(pooled_analysis$fc_1, ref="misinformation")

pooled_analysis$fc_2 <-
  as.factor(pooled_analysis$fc_2)
pooled_analysis$fc_2 <- 
  relevel(pooled_analysis$fc_2, ref="misinformation")

pooled_analysis$fc_3 <-
  as.factor(pooled_analysis$fc_3)
pooled_analysis$fc_3 <- 
  relevel(pooled_analysis$fc_3, ref="misinformation")
```

```{r, include = FALSE, message = FALSE}
#Creating monthly attendance variable
pooled_analysis$monthly_attend <- ifelse(pooled_analysis$attend_cleaned %in% c("Medium", "High"), 1, 0)
```

## Interactions with partisanship

```{r, include = FALSE, message = FALSE}
#Alliance Defending Freedom models

#Without controls
pooled_adf_partisanship_v1 <-
  lm_robust(thermometer_1 ~ fc_1*pid_cleaned, data = pooled_analysis)
#With controls
pooled_adf_partisanship_v2 <-
  lm_robust(thermometer_1 ~ fc_1*pid_cleaned + male + college_grad + age + relig_affiliated + 
    monthly_attend + study, data = pooled_analysis)
```

```{r, echo = FALSE, results='asis'}
#Creating regression talbe
texreg(list(pooled_adf_partisanship_v1, pooled_adf_partisanship_v2), include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check",
          "Independent/Other", "Republican",
          "Control*Independent/Other",
          "Fact-check*Independent/Other",
          "Control*Republican",
          "Fact-check*Republican"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between being a Republican/Independent (vs. being a Democrat) and fact-check of the claim that abortion pills are dangerous on attitudes toward Alliance Defending Freedom (0-to-100 scale)", 
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE,
       custom.model.names = c("Without controls", "With controls"),
omit.coef = "male|college_grad|age|relig_affiliated|monthly_attend|study")
```

```{r, include = FALSE, message = FALSE}
#Seth Gruber models

#Without controls
pooled_gruber_partisanship_v1 <-
  lm_robust(thermometer_2 ~ fc_2*pid_cleaned, data = pooled_analysis)
#With controls
pooled_gruber_partisanship_v2 <-
  lm_robust(thermometer_2 ~ fc_2*pid_cleaned + male + college_grad + age + relig_affiliated + 
    monthly_attend + study, data = pooled_analysis)
```

```{r, echo = FALSE, results='asis'}
#Creating regression talbe
texreg(list(pooled_gruber_partisanship_v1, pooled_gruber_partisanship_v2), include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check",
          "Independent/Other", "Republican",
          "Control*Independent/Other",
          "Fact-check*Independent/Other",
          "Control*Republican",
          "Fact-check*Republican"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between being a Republican/Independent (vs. being a Democrat) and fact-check of the claim that contraception availability increases abortion demand on attitudes toward Seth Gruber (0-to-100 scale)", 
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE,
       custom.model.names = c("Without controls", "With controls"),
omit.coef = "male|college_grad|age|relig_affiliated|monthly_attend|study")
```

```{r, include = FALSE, message = FALSE}
#Americans United For Life models

#Without controls
pooled_aufl_partisanship_v1 <-
  lm_robust(thermometer_3 ~ fc_3*pid_cleaned, data = pooled_analysis)
#With controls
pooled_aufl_partisanship_v2 <-
  lm_robust(thermometer_3 ~ fc_3*pid_cleaned + male + college_grad + age + relig_affiliated + 
    monthly_attend + study, data = pooled_analysis)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(list(pooled_aufl_partisanship_v1, pooled_aufl_partisanship_v2), include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check",
          "Independent/Other", "Republican",
          "Control*Independent/Other",
          "Fact-check*Independent/Other",
          "Control*Republican",
          "Fact-check*Republican"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between being a Republican/Independent (vs. being a Democrat) and fact-check of claim about the pregnant 10-year-old on attitudes toward Americans United For Life (0-to-100 scale)", 
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE,
       custom.model.names = c("Without controls", "With controls"),
omit.coef = "male|college_grad|age|relig_affiliated|monthly_attend|study")
```


## Interactions with religiosity

```{r, include = FALSE, message = FALSE}
#Alliance Defending Freedom models

#Without controls
pooled_adf_religiosity_v1 <-
  lm_robust(thermometer_1 ~ fc_1*attend_cleaned, data = pooled_analysis)
#With controls
pooled_adf_religiosity_v2 <-
  lm_robust(thermometer_1 ~ fc_1*attend_cleaned + male + college_grad + age +  
    pid_cleaned + study, data = pooled_analysis)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(list(pooled_adf_religiosity_v1, pooled_adf_religiosity_v2), include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check",
          "High attendance", "Low attendance",
          "Control*High attendance",
          "Fact-check*High attendance",
          "Control*Low attendance",
          "Fact-check*Low attendance"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between having high/low religious attendance (vs. medium attendance) and fact-check of the claim that abortion pills are dangerous on attitudes toward Alliance Defending Freedom (0-to-100 scale)", 
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE,
       custom.model.names = c("Without controls", "With controls"),
omit.coef = "male|college_grad|age|pid_cleaned|study")
```

```{r, include = FALSE, message = FALSE}
#Seth Gruber models

#Without controls
pooled_gruber_religiosity_v1 <-
  lm_robust(thermometer_2 ~ fc_2*attend_cleaned, data = pooled_analysis)
#With controls
pooled_gruber_religiosity_v2 <-
  lm_robust(thermometer_2 ~ fc_2*attend_cleaned + male + college_grad + age + 
    pid_cleaned + study, data = pooled_analysis)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(list(pooled_gruber_religiosity_v1, pooled_gruber_religiosity_v2), include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check",
          "High attendance", "Low attendance",
          "Control*High attendance",
          "Fact-check*High attendance",
          "Control*Low attendance",
          "Fact-check*Low attendance"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between having high/low religious attendance (vs. medium attendance) and fact-check of the claim that contraception availability increases abortion demand on attitudes toward Seth Gruber (0-to-100 scale)", 
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE,
       custom.model.names = c("Without controls", "With controls"),
omit.coef = "male|college_grad|age|pid_cleaned|study")
```

```{r, include = FALSE, message = FALSE}
#Americans United For Life models

#Without controls
pooled_aufl_religiosity_v1 <-
  lm_robust(thermometer_3 ~ fc_3*attend_cleaned, data = pooled_analysis)
#With controls
pooled_aufl_religiosity_v2 <-
  lm_robust(thermometer_3 ~ fc_3*attend_cleaned + male + college_grad + age + 
    pid_cleaned + study, data = pooled_analysis)
```

```{r, echo = FALSE, results='asis'}
#Creating regression table
texreg(list(pooled_aufl_religiosity_v1, pooled_aufl_religiosity_v2), include.ci = FALSE,
       custom.coef.names = c("Intercept", "Control", "Fact-check",
          "High attendance", "Low attendance",
          "Control*High attendance",
          "Fact-check*High attendance",
          "Control*Low attendance",
          "Fact-check*Low attendance"),
       stars = c(0.05, 0.01, 0.001), 
       caption = "Interaction between being having high/low religious attendance (vs. having medium attendance) and fact-check of claim about the pregnant 10-year-old on attitudes toward Americans United For Life (0-to-100 scale)", 
       caption.above = TRUE, float.pos = "H",
       single.row = TRUE,
       custom.model.names = c("Without controls", "With controls"),
omit.coef = "male|college_grad|age|pid_cleaned|study")
```

```{r, include = FALSE, message = FALSE}
#Saving rows of data frame in which respondents receive a condition assignment related to Seth Gruber (fc_2)
pooled_data_gruber <-
  pooled_analysis %>%
  dplyr::filter(!is.na(fc_2))

#Dropping columns that aren't relevant
pooled_data_gruber$thermometer_1 <- NULL
pooled_data_gruber$fc_1 <- NULL
pooled_data_gruber$thermometer_3 <- NULL
pooled_data_gruber$fc_3 <- NULL

save(pooled_data_gruber, file = "pooled_data_gruber_studies1_and_2.RData")
```


